How To Send Email to Collection of Records In Zoho Creator With Example
The best way to send collection of records in Zoho Creator is using String field. Deluge script helps us to achieve this in an easy and effective way.
Issues like sending multiple records in a one email based on common criteria will be challenging for a new coder as well as some intermediate level coders.
For example, in a scenario, where system should trigger multiple records from a Zoho Creator report to a particular user based on a criteria where student ID is same. In that case, we can achieve that by the following code snippet.
Sample code:
str="<table border="1" style="border-collapse:collapse;"><tr><th>Student ID</th></th>Contact Number</th></tr>";
for each r in test_form[Emaill == input.Email]
{
str = str+"<tr><td>"+r.Student_ID<+"/td></td>"+r.Contact_Number+"</td></tr>";
}
str="</table>";
sendmail
[
from : zoho.adminuserid
to : input.email
subject : "sending collection of data from zoho creator report using common criteria"
message :str
]
You can make necessary changes to the above sample code as per your own requirement.
Note; The table style value "border=1"and the inline style style="border-collapse:collapse;" will assign the table border to one and collapse it to a single lined border to make it look better.
You can add more custom css to the table elements to make it much more professional.
Issues like sending multiple records in a one email based on common criteria will be challenging for a new coder as well as some intermediate level coders.
For example, in a scenario, where system should trigger multiple records from a Zoho Creator report to a particular user based on a criteria where student ID is same. In that case, we can achieve that by the following code snippet.
Sample code:
str="<table border="1" style="border-collapse:collapse;"><tr><th>Student ID</th></th>Contact Number</th></tr>";
for each r in test_form[Emaill == input.Email]
{
str = str+"<tr><td>"+r.Student_ID<+"/td></td>"+r.Contact_Number+"</td></tr>";
}
str="</table>";
sendmail
[
from : zoho.adminuserid
to : input.email
subject : "sending collection of data from zoho creator report using common criteria"
message :str
]
You can make necessary changes to the above sample code as per your own requirement.
Note; The table style value "border=1"and the inline style style="border-collapse:collapse;" will assign the table border to one and collapse it to a single lined border to make it look better.
You can add more custom css to the table elements to make it much more professional.
Comments
Post a Comment