What is an Offline Email Notification?
Your users are not expected to be on your website 24x7. When a user is offline, other users can send them a message on your website via AtomChat.
With the Email Notifications feature, offline users are sent an automatic Email notifying them that they have unread messages on your website.
Don't have this feature in your plan?
Offline Email Notifications is an add-on feature. To add it to your plan, please Contact Us!
Ensure offline users do not miss out on conversations and important messages, learn how to configure AtomChat's Offline Email Notifications feature!
Email notifications can be sent to users for One-on-One & Group Chats for the following features:
- Text Messages
- Stickers
- Emoticons
How to Enable Email Notifications?
Step 1
Log in to your AtomChat Admin Panel
Step 2
Click on “Features” & activate “Offline Email notifications”
Step 3
Click on the configure icon & enter all details - “SMTP host”, “SMTP username”, “SMTP password”, “From Email address”, “From Name”, “Minutes for which a user must be offline to receive an email”.
NOTE: Please test your SMTP configuration before entering the details with online tools such as GMass If the details work properly here, then it will work properly in AtomChat as well.
IMPORTANT
- Please make sure you have allowed access to new devices or applications in Google security settings. Login to your Google account and access the following link: https://accounts.google.com/DisplayUnlockCaptcha
- Also, go to the Less secure app access section of your Google Account. You might need to sign in.
Turn Allow less secure apps off. Login to your Google account and access the following link: https://www.google.com/settings/security/lesssecureapps
What are "Minutes for which a user must be offline to receive an email"?
It simply means the number of minutes after which a user will receive the email if they are offline. If you have set this setting to “30” Minutes then the user who is offline for the last 30 minutes or more will get an email notification.
Step 4
Customize your Email notification template as per your requirement.
Step 5
In “Offline Email notifications” settings you can see “Cron URL”. You have to set up a cron job as per your requirement. It's easy to set a cron job on easycron.com
What is a Cron Job?
A cron job is a command for scheduling a task to be executed for the specified time in the future. It is normally used to schedule a job that is executed periodically.
Example: You have two users: “User 1” & “User 2”.If “User 2” is offline for the last 20 minutes, they will get an Email notification on their registered Email address as per the Cron Job settings in “Offline Email notification.”
How should I set a Cron Job on easycron.com?
Following are the steps to set Cron Job on EasyCron:
Step 1
Create your account on easycron.com. Make sure you will have a paid account (with plan Plus or above).
Step 2
Log in to easycron.com with your credentials. You will be redirected to the dashboard and in the left menu, you will see the ‘Cron Job’ button.
As you click on that button, a pop-up will appear where details like URL to call, when to execute are mandated.
In the “URL to call” tab, please enter the URL of CometChat Cron Job (Please refer to Step 5).
Please don’t enter the entire URL here. You need to enter the URL till cron.php. Please see the screenshot below. Also, select the execution time as per your requirement.
Step 3
Now click on the “HTTP” tab. Enter a value in HTTP method & once you set the HTTP method to POST, you will see the HTTP message body option.
In “HTTP message body” you need to enter parameters which are after “cron.php”.
You will get the AtomChat cron URL as mentioned in step 5 of “How to enable email notification” section. From that URL you need to copy the part after cron.php. Please refer to the screenshot.
Now click on the “Create Cron” button. If you have set an hour to execute the option, then your Cron Job will run after every 1 hour.
How to set Email Addresses for each and every user?
There are two ways to set email addresses for all users.
Method 1
You have to set the chat_email variable where you have already set all other AtomChat variables like chat_id, chat_name, chat_link, etc.
You have to pass the email address to the chat_email variable. For example:
var chat_email = ‘[email protected]’;
Once a user logs in to your website, it will update their email address in AtomChat.
You can see the email address in your AtomChat Admin Panel -> Users -> Click on the Edit user icon.
Method 2
You can use our Create User or Update User RESTFul API to update the email address of each and every user.
Please refer to the screenshots below.
1. Create User API
2. Update User API
Need help?
If you are facing any difficulty or need help configuring Email Notifications, please Contact Us!
Happy to help :)
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article