69
Views
54
Comments
Trigger email notification

Hi Team,

I want to trigger an email notification upon status change and also when due date is near. How can i achieve that. Screen i have created is Customer Email.

Thanks,

Gagana

MF.OML
2024-05-02 09-49-04
Murali Manoharan V
Champion
2024-07-12 05-57-50
Gourav Shrivastava
Champion

Hi @Gaganashree Lohit ,

You can achieve both using Timers in OutSystems. Here's how you can approach it:

1. Status Change Email Notification

Inside the action where the status is updated, you can add a Send Email logic, or you can also run a timer to check if a specific status, so send mail to them.

To ensure an immediate email is sent whenever the status changes, don't use a timer.

2. Due Date Reminder Email

Use a Timer to check for items where the due date is approaching.

Example logic inside the Timer:-

Fetch records where DueDate = CurrDate + 1 (i.e., due tomorrow).

For each record, send an email to the assigned customer/contact, also add one boolean type variable inside the entity to check is already been processed or not.

because sometimes if you have more larger record set so you need to adapt the best practice timer with a timeout handle, but only if you have a large dataset to process.

You can schedule the Timer to run daily 

I recommend to you follow this article if you have a large dataset


Thanks 

Regards,

Gourav Shrivastava

UserImage.jpg
Gaganashree Lohit

Is SMTP Configuration is mandatory to trigger notification?

2024-05-02 09-49-04
Murali Manoharan V
Champion

For sending mails SMTP configuration is mandatory.

UserImage.jpg
Gaganashree Lohit

Hi Murali,

In the SMTP server field what exactly i need to give. Is it smtp.gmail.com? Also i do not see Password field.

Also the Host Name they are looking : what value should i give. I am using Personnel environment.

2024-05-02 09-49-04
Murali Manoharan V
Champion


If you want to send email using Gmail, you have to setup an app password that we will use in the email configuration inside Service Center. 

Follow the below instructions:

  • Go to https://myaccount.google.com/security 
  • Under Signing in to Google click on App passwords
  • Sign in again using your Gmail username and password
  • Generate an app password an copy the value
  • Login to Service Center of your Personal Environment
  • Go to Administration > Email
  • Paste the generated app password in the Password field
  • Click Save and Apply Settings to the Factory
  • That's it, you should be able to send emails now

Regards,

Murali

2024-05-02 09-49-04
Murali Manoharan V
Champion

Password field not showing in service center is a bug in outsystems end. By default it's not visible. 

But if you select the authentication as Oauth and select basic again, at that time it's visible.

UserImage.jpg
Gaganashree Lohit

Hello Murali,

I do not see anything that is named app password.

2024-05-02 09-49-04
Murali Manoharan V
Champion

please use this documentation to create app passwords

https://support.google.com/mail/answer/185833?hl=en

UserImage.jpg
Gaganashree Lohit

Hello Murali,

I have generated App password which is 16 digit. My question is should i update my existing gmail password with the new generated app password or should i use the app password inside the Service center in email tab?

Also Murali, what to give in the Host Name?

2024-05-02 09-49-04
Murali Manoharan V
Champion

No need to update your existing gmail password. You just need to use the app password in Service Center email tab. 



UserImage.jpg
Gaganashree Lohit

I am done till here Murali. Thanks for all your support. Can you guide me whats the next step.

2024-05-02 09-49-04
Murali Manoharan V
Champion

Add the app password in password box and click on Save and Apply Settings to factory.

Then follow these steps for triggering the email

https://success.outsystems.com/documentation/11/building_apps/sending_emails_from_apps/sending_emails/


Regards

Murali


UserImage.jpg
Gaganashree Lohit

Hello Murali,

I followed the link and created the below, clicking on the send email buttom, i am nor receiving any email to my inbox?


2024-05-02 09-49-04
Murali Manoharan V
Champion

hello @Gaganashree Lohit 

Have you checked the logs in service center? Can you please share the logs


And I hope you didn't select this check box in email tab


If you select the checkbox then we will receive emails in test list provided in Test List Addresses only.


Regards 

Murali

UserImage.jpg
Gaganashree Lohit

I selected it Murali,

And in the error log i do not see any error message. The welcome email successfully sent soumyadip. I am having one more question, if i want to send this to multiple person how can i achieve this functionality?

But in the welcome email i have given, To as "appi8030@gmail.com" and CC to "Soumyadip.parui@banetti.com". Only he received the email but not appi8030. why is that?

2024-05-02 09-49-04
Murali Manoharan V
Champion

you need to unselect the check box for sending mails to real email ids. Unless that mails will be sent to test list emails only. That option is used for testing purposes in real time project before going live. 


If you want to send mails to multiple persons separately then assign the mail dynamically in loop instead of static assignment "xxx@gmail.com" 

UserImage.jpg
Gaganashree Lohit

How this can be done : If you want to send mails to multiple persons separately then assign the mail dynamically in loop instead of static assignment "xxx@gmail.com" ?

2026-01-28 16-57-48
Mihai Melencu
Champion

Hi, you can create a list of the email addresses you want to send to, then use a ForEach loop to go through the list and call the Send Email action for each address. 

2024-05-02 09-49-04
Murali Manoharan V
Champion

Hi @Gaganashree Lohit 

You can do as like @Mihai Melencu said. It will help you to send mails separately

UserImage.jpg
Gaganashree Lohit

Hello Mihai,

I am trying to update the status of the customer from new to other status, when i update in the screen it is not saving in the database. Could you please help me on this?

MF Status.OML
2026-01-28 16-57-48
Mihai Melencu
Champion

Hi, in your assignment to UpdatedCustomer.Status, you're mistakenly assigning the old status instead of the new one. 

Before (Wrong):

After (Correct):

You can also check the updated OML I attached.

MF Status.OML
UserImage.jpg
Gaganashree Lohit

Oh, my all-time Saviour thank you.

UserImage.jpg
Gaganashree Lohit

Mihai,

I have created a template for email which is under commons. How can i fetch the status and customer name dynamically?

2026-01-28 16-57-48
Mihai Melencu
Champion

Hi, you can create an input parameter for both the status and customer name in the email template.

UserImage.jpg
Gaganashree Lohit

Like CustomerName and datatype as Customer and StatusId and datatype as Status or should i have to use Data type as identifier?

2026-01-28 16-57-48
Mihai Melencu
Champion

I assume you want to display the status label (not the ID), so in that case, set the type to Text and pass the status label as the variable.

Similarly, for the CustomerName, if you're only showing the name, you can also use a Text type and pass the customer name directly.

UserImage.jpg
Gaganashree Lohit

I am getting error message.

UserImage.jpg
Vijay sundaram

Hi @Gaganashree Lohit,
Hope you're doing well!

Could you please remove the GetCustomer() function and instead just include customer.name and status

Thanks!

UserImage.jpg
Gaganashree Lohit

Vijay, even if i use just Customer.name i am getting error,

UserImage.jpg
Gaganashree Lohit

Hello Mihai, Can you please help me on this to create email template with changed status name and the customer name i want to have it in the template.

2026-01-28 16-57-48
Mihai Melencu
Champion

Can you please share your OML with the template?

UserImage.jpg
Gaganashree Lohit

Here is the OML.

MF Template.OML
UserImage.jpg
Gaganashree Lohit

Mihai, please help, as this is very urgent and i need to present with my team.

UserImage.jpg
Gaganashree Lohit

I have created Input Parameters under my email template but in the Send email server action it is asking value for the input i created in the email template, Dropdown also not suggesting any value please help on this.

2026-01-28 16-57-48
Mihai Melencu
Champion

Hi,

After setting the input parameters in your email, make sure to also add them to the server action. Then, in the main action where you're calling it, pass the values directly from the UpdateCustomer local variable.

For the subject, you can use an input parameter to build the title dynamically.

Please check the updated OML.

MF Template_updated.OML
UserImage.jpg
Gaganashree Lohit

Hello Mihai,

Only customer name is fetching but not the changed status reflecting in the email,

2026-01-28 16-57-48
Mihai Melencu
Champion

Mistake on my part, seems I passed the wrong variable to the server action:

Please check the updated OML.


MF Template_updated.OML
UserImage.jpg
Vijay sundaram

Hi Gaganashree Lohit ,

Here I attached the OML

MF Template.OML
UserImage.jpg
Gaganashree Lohit

Hello Vijay,

Thanks for the OML But it is not fetching the dynamic value instead i can see like this,

UserImage.jpg
Gaganashree Lohit

Hello Team,

I have devoloped a logic to send email notification when due date reaches, but i am not getting the notification. I have attached the OML.

Regards,

Gagana

MF DueDate Template.OML
2026-01-28 16-57-48
Mihai Melencu
Champion

Hi! You need to assign a timer along with the desired action; otherwise, the action won’t be triggered. You can learn more about how timers work here: https://success.outsystems.com/documentation/11/reference/outsystems_language/processes/timer/ 

MF DueDate Template.OML
UserImage.jpg
Gaganashree Lohit

Hello Mihai,

I have done this, is this right?. Please check my OML

MF timer update..oml
2026-01-28 16-57-48
Mihai Melencu
Champion

Yes, that's correct this timer will trigger the action daily at midnight (00:00). 

UserImage.jpg
Gaganashree Lohit

Hello Mihai,

I have set timer to 8:45pm Just to check if the notification triggers, but it did not. Due date is today though i did not receive any notification?

2026-01-28 16-57-48
Mihai Melencu
Champion

There might be a time zone difference between your local time and the server's. To ensure the timer runs reliably, set it to "When Published"  this guarantees it will trigger right after you publish the module. 

UserImage.jpg
Gaganashree Lohit

Hi Mihai,

I changed the setting to "While publish", and now I receive an email notification every time I click on publish. However, I only need the notification to be sent once, specifically when the current date equals the Due Date.

How can I achieve this?


2026-01-28 16-57-48
Mihai Melencu
Champion

You can add an if condition to check if the aggregate is empty. If it is, simply end the action; otherwise, continue as normal. Please check the updated sample. As for the schedule set it back to daily at an hour you want 

MF.oml
UserImage.jpg
Gaganashree Lohit

I’ve added the changes, including setting the correct time zone. However, just like yesterday, I still haven’t received any notification. 

2026-01-28 16-57-48
Mihai Melencu
Champion

Please check service center for the server time so you set the right hour, you can also check the Timer logs to see if the timer has been triggered. 

UserImage.jpg
Gaganashree Lohit

Hello Mihai,

I referred Service Center Time. I should have received notification at 7:45, but i did not.

Timer Log looks like this,

UserImage.jpg
Gaganashree Lohit

Team please anyone help me on this.

UserImage.jpg
Supriya Malla

Hi @Gaganashree Lohit,

It looks like you're trying to call the DueDate email in a server action named Timer, but you're not triggering this action anywhere.

There are two main ways to resolve this:

  1. Use a Scheduled Timer: If the email should be sent at a specific time or on a schedule, you can use Timer feature to trigger the server action automatically at a set interval. You just need to:

    • Create a Timer in the Logic tab.

    • Set the schedule for the Timer (e.g., daily or weekly).

    • call your server action (Timer) to the Timer, ensuring it calls the email logic when it runs.

    • Make sure the Timer is enabled and active.

  2. Trigger the Server Action Manually with a Button: If you want the email to be sent when the user clicks a button, you can call the Timer server action from the button's On Click event. This way, you have manual control over when the email is triggered.

    • In the button's On Click action, call the server action (Timer).

Either of these approaches will work depending on whether you want automatic scheduling or manual triggering for the email. In the attached OML I have triggered that action using the Timer Check it out!!

Let me know if you need further details!

Thanks,

Supriya

MF DueDate Template.OML
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.