/

 

The manual

Self-training

Experimentation

Contact

 

Language

Automatic preparation / sending of emails

Warning: in Storga, a sent email is called a message, the 'mail' type being reserved for received emails.

Example of creating a new message:

var File f := ...

new_msg page "id_de_la_page"
  msg_from_user := "my_storga_site/my_user_id"
  msg_from_mailbox := "my_storga_site/my_storga_mailbox_id"
  msg_to += "Somebody <some_mailbox.some_domain.extension>"
  msg_cc += "Somebody else <another_mailbox.another_domain>"
  msg_subject := "The mail subject"
  new_para "Some text content"
  new_file f
  msg_url page
  send_msg

The options that can be used on the 'new_msg' line are the same as those that can be used with the 'new_form' instruction, except for 'copy_fields' which has no meaning here.

'msg_from_user' is optional. The default is the account of the user who triggered the execution of the program, or by default, that of the user who signed the program.

'msg_from_mailbox' can be either the sender's email address or the Storga ID of the mailbox to use. This is the only mandatory instruction before 'send_msg'.

'new_file' is used to attach one (or more) file attachments.

'msg_url' is optional and used to add a link to a Sorga page at the bottom of the mail. There are several variations:

msg_url

msg_url nomenu

msg_url page "id_d'un_bloc_ou_d'une_page_storga"

msg_url page "id_d'un_bloc_ou_d'une_page_storga" nomenu

These variants allow you to include a link to a page other than the one where the email will be stored and to possibly hide the left column Storga with the menus.
Finally, when the email includes a link to the form that recipients are asked to complete (see 'msg_form_to' instruction below), we can also use the following form to specify the wording of the link:

msg_url form "Pour répondre en ligne, suivez le lien suivant"

'send_msg' is used to send the email immediately, as opposed to just pre-filling it and letting the user control it, edit it if necessary, and then send it via the 'Send' button.

The 'msg_address' instruction allows you to specify whether the list of email recipients must be visible to all recipients or not:

msg_address hidden

and

msg_address visible

Finally, the 'msg_form_to' instruction looks like 'msg_to', but in addition, it associates the current form with the recipient, by adding a link allowing him to fill it online:

msg_form_to "Somebody <some_mailbox@some_domain.extension>"

For more details about 'msg_form_to', refer to the document 'Send the mailing of an online questionnaire'.