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
Hi @Gaganashree Lohit
For SMTP mail configuration you need to follow these steps
https://success.outsystems.com/documentation/11/managing_outsystems_platform_and_application_lifecycle/configure_outsystems_to_send_emails/
For triggering email you need to follow these steps https://success.outsystems.com/documentation/11/building_apps/sending_emails_from_apps/sending_emails/
Hope it will help you
Regards
Murali
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
Is SMTP Configuration is mandatory to trigger notification?
For sending mails SMTP configuration is mandatory.
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.
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:
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.
Hello Murali,
I do not see anything that is named app password.
please use this documentation to create app passwords
https://support.google.com/mail/answer/185833?hl=en
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?
No need to update your existing gmail password. You just need to use the app password in Service Center email tab.
I am done till here Murali. Thanks for all your support. Can you guide me whats the next step.
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/
I followed the link and created the below, clicking on the send email buttom, i am nor receiving any email to my inbox?
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.
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?
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"
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" ?
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.
You can do as like @Mihai Melencu said. It will help you to send mails separately
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?
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.
Oh, my all-time Saviour thank you.
Mihai,
I have created a template for email which is under commons. How can i fetch the status and customer name dynamically?
Hi, you can create an input parameter for both the status and customer name in the email template.
Like CustomerName and datatype as Customer and StatusId and datatype as Status or should i have to use Data type as identifier?
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.
I am getting error message.
Hi @Gaganashree Lohit, Hope you're doing well!
Could you please remove the GetCustomer() function and instead just include customer.name and status
Thanks!
Vijay, even if i use just Customer.name i am getting error,
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.
Can you please share your OML with the template?
Here is the OML.
Mihai, please help, as this is very urgent and i need to present with my team.
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.
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.
Only customer name is fetching but not the changed status reflecting in the email,
Mistake on my part, seems I passed the wrong variable to the server action:
Thank you Mihai.
Hi Gaganashree Lohit ,Here I attached the OML
Hello Vijay,
Thanks for the OML But it is not fetching the dynamic value instead i can see like this,
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.
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/
I have done this, is this right?. Please check my OML
Yes, that's correct this timer will trigger the action daily at midnight (00:00).
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?
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.
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?
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
I’ve added the changes, including setting the correct time zone. However, just like yesterday, I still haven’t received any notification.
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.
I referred Service Center Time. I should have received notification at 7:45, but i did not.
Timer Log looks like this,
Team please anyone help me on this.
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:
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.
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!
Supriya