You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

send_html_mail()

Usage

send_html_mail(fromAddress, fromName, toAddress, toName, subject, htmlContent, textContent [, attachments])

Description

Sends an HTML e-mail with the given configuration. See Mail Configuration for more information. The e-mail methods are the main use-case for the template() method.

2.0.2 An optional list of files (instances of FileBase) can be passed to the command. The files will be sent as e-mail attachments.

Note

Attachments have to be provided as a list - even if only one file should be attached.

Example

${send_html_mail('info@structr.com', 'Structr', 'user@domain.com', 'Test User', 'Welcome to Structr', '<p>Hi <b>User</b>,</p><p>welcome to Structr!</p>', 'Hi User,\n\nwelcome to Structr!')}

Search results for "send_html_mail()"

send_html_mail()

Sends an HTML e-mail with the given configuration. See Mail Configuration for more information. The e-mail methods are the main use-case for the template() method.

Available from 2.0.2: An optional list of files (instances of File) can be passed to the command. The files will be sent as e-mail attachments.

send_html_mail(fromAddress, fromName, toAddress, toName, subject, htmlContent, textContent [, attachments] )

afterCreate

  • Is called after an object has been created (onCreate has already been executed), all checks have passed successfully and the transaction has been committed
  • Multiple afterCreate methods can exist per type - every method prefixed with afterCreate is called after an object has been created successfully (e.g. afterCreate01, afterCreate02)
  • can not roll back the transaction
  • is useful for actions that should only happen if the node is sure to have been created. For example sending a mail: Calling send_html_mail() in onCreate would send the email even if the transaction would be rolled back due to an error.
  • All regular keywords can be used - no special keywords are introduced for this method

Example: