Lo script seguente genera il testo dell'email da inviare al cliente dinamicamente in base alla lingua associata al cliente stesso.
Testo = ""
Lingua = RowItem.Anag.CustomField(82)
RagioneSocialeCliente = RowItem.Anag.CustomField(10)
NumeroDocumento = RowItem.CustomField(10)
DataDocumento = RowItem.CustomField(20)
NomeCorriere = RowItem.CustomField(180)
'TrackingNumber = RowItem.CustomField(188)
Select Case Trim(UCase(Lingua))
Case "ITALIANO", ""
' testo se il cliente e' associato alla lingua italiana oppure se non e' indicata nessuna lingua
' usa il testo in ITALIANO
Testo = "Gentile cliente," & vbCrLf
Testo = Testo & "oggi abbiamo evaso un ordine a nome di " & RagioneSocialeCliente & " con documento nr. " & NumeroDocumento & " del " & DataDocumento & ", il pacco e' stato spedito con corriere " & NomeCorriere
Testo = Testo & vbCrLf
Testo = Testo & "Sul sito internet del corriere oppure loggandosi sul nostro sito potra' controllare il tracking online. Ricordiamo che il tracking funziona dopo le ore 23 del giorno della spedizione."
Testo = Testo & vbCrLf
Testo = Testo & "Per qualsiasi problema puo' contattarci ai numeri indicati in questa pagina: "
Testo = Testo & "http://www.ilmiosito.com/contatti.asp"
Case Else
' per qualsiasi altra lingua invia il messaggio in INGLESE
Testo = "Dear customer," & vbCrLf
Testo = Testo & "today we shipped an order under the name of " & RagioneSocialeCliente & ", invoice numb. " & NumeroDocumento & " , " & DataDocumento & ", the package has been shipped by " & NomeCorriere & " courier"
Testo = Testo & vbCrLf
Testo = Testo & "You’ll be able to make the online tracking of your packeage logging on the courier’s website or just by our website. Don’t forget that the tracking number is working after 11.00PM, the day after the goods has been shipped."
Testo = Testo & "For any question you may contact us by telephone, click here:"
Testo = Testo & "http://www.ilmiosito.com/contatti.asp"
End Select
' Accoda al testo la firma dell'azienda
Testo = Testo & vbCrLf
Testo = Testo & vbCrLf
Testo = Testo & "LA MIA AZIENDA srl" & vbCrLf
Testo = Testo & "Tel +123-4567890" & vbCrLf
Testo = Testo & "Fax +123-4567890" & vbCrLf
' Restituisce il testo completo a Ready
Response.Write(Testo)