Actions

Difference between revisions of "BeforeEmail"

From LimeSurvey Manual

(Page creation with current input and output)
 
m (<nowiki>)
Line 14: Line 14:
 
* type : Email type : 'errorsavingresults', 'passwordreminderadminuser', 'addadminuser', 'mailsendusergroup'. default is unknow, and deprecated usage of function is 'deprecated'
 
* type : Email type : 'errorsavingresults', 'passwordreminderadminuser', 'addadminuser', 'mailsendusergroup'. default is unknow, and deprecated usage of function is 'deprecated'
 
* subject : Email subject
 
* subject : Email subject
* to : Recipient(s) with format <code>[email,name]</code>
+
* to : Recipient(s) with format <code><nowiki>[email,name]</nowiki></code>
 
* body : Email body content
 
* body : Email body content
 
* from : Sender (From)
 
* from : Sender (From)
Line 28: Line 28:
 
* subject : Email subject
 
* subject : Email subject
 
* body : Email body content
 
* body : Email body content
* to : Recipient(s) in <code>[[email,name]]</code> format
+
* to : Recipient(s) in <code><nowiki>[[email,name]]</nowiki></code> format
 
* from : From email and name
 
* from : From email and name
 
* bounce : Return-Path
 
* bounce : Return-Path

Revision as of 14:13, 23 May 2019

Notice.png
 Hint: This features is available starting in version 4.0.0


Important.png  This feature is currently implemented in beta version of LimeSurvey.



Usage

This event can be used each time an email not related to a survey is send.

Input

The event receives the following information:

  • mailer : The mailer object
  • type : Email type : 'errorsavingresults', 'passwordreminderadminuser', 'addadminuser', 'mailsendusergroup'. default is unknow, and deprecated usage of function is 'deprecated'
  • subject : Email subject
  • to : Recipient(s) with format [email,name]
  • body : Email body content
  • from : Sender (From)
  • bounce : The Sender (Return-Path)
  • survey : null
  • model : null
  • updateDisable : array

Possible output

The following information can be set in the event:

  • updateDisable : if plugin use mailer to update other parts, allow to disable update by default action
  • subject : Email subject
  • body : Email body content
  • to : Recipient(s) in [[email,name]] format
  • from : From email and name
  • bounce : Return-Path
  • send : If true Limesurvey will send the email. Setting this to false will cause Limesurvey to assume the mail has been sent by the plugin.
  • message : If send is true and action return a message : the message to be shown
  • error : If set and "send" is true, log the error as failed email attempt.

Example