How to use plugin SendEmail

SendEmail plugin helps you to send emails easily. This tutorial shows you how to send email on button click. In our example we will create an action that will send welcome email to our new costumer.

1. Login into developer panel.

2. Before you can use plugin you need to install it. Navigate to Plugins > Menage plugins. Click on FIND NEW PLUGIN. Select plugin and than click on Install buton.

Find new plugin

3. After you installed SendEmail plugin, navigate to Plugins > SendEmail. On this page you can add/edit or delete email template, configure email server and send test email. Plugin automatically sets up sample of email template.

Send email list

4. Click on Add template or Edit template. Enter template name and template HTML/CSS code in HTML editor. On the right side of HTML Editor, you can see list of positions in HTML email template. These “variables” will be replaced with text you pass in server function SendEmail as parameters. Click on Save button.

HTML Editor

5. Click on Server configuration button. Enter email server configuration and click on Save button.

Email config

6. Navigate to Pages menu item.

7. Select page pageRegistrationCostumer.

8. Drag and drop Action component to button ButtonRegister.

9. Select Server function as Action type.

Send email

10. Click on text area under Action code label. Select SendEmail plugin and select SendEmail function. Enter some of parameters such as from, subject, templateName. Some of these parameters will be placed in email template such as heading1, text1, text2, text3, text4, button1Name, button1Link, button2Name, button2Link and they are optional. Drag and drop {TextboxEmailRegistration} value from the left side to email parameter field on the right side. Parameter email will be used as email address on which email will be sent. Click on Save button.

Send email parameters

11. Click on Save changes button, go to your application and check out the results.

You can also use SendEmail function in your PHP code in action.
Example of PHP code with SendEmail function:


$componentService = Services::GetComponentService();
$componentService->ExecuteServerFunction(
  "Functions.Plugins.SendEmail.SendEmail.SendEmail",
  array(
    "from"=>"demo application",
    "subject"=>"New registration",
    "heading1"=>"Welcome",
    "text1"=>"You have been successfully registered",
    "text2"=>"", "text3"=>"", "text4"=>"",
    "button1Name"=>"Login",
    "button1Link"=>"https://demo.izzedoappbuild.com/",
    "button2Name"=>"", "button2Link"=>"",
    "email"=>{TextboxEmailRegistration},
    "templateName"=>"demo_template",
    "emailFrom"=>""
  )
);