I am Using Creatio 8.2.2 and am currently confused on how to send an email and taking fields from a page and inserting it into the script task, here is my script task
i am trying to take a field called Alamat Penilai as the Send email to
also inserting Nama Penilai, Nama Debitur, Produk, Tujuan Penilaian, Jenis Agunan into the body of the email, one of the fields is a dropdown aswell(extra info if needed). I am also going to use SMTP as a way to send the email from
so how do i go about this? how do i configure the script task to run as i wish?
Like
An easy way is to just read the data in the process using Read Data elements, then use formulas to place any values in process parameters. Then, in the script task you can just retrieve them using:
var recipient = Get<string>("MyRecipientParameter");
Basically, retrieve any process parameter using:
var val = Get<type>("TheParameterName");
Also, it's possible to just add a mailbox in the system with the send SMTP values only and uncheck the downloading email option so it's a send only account. See (sorry, very old screenshot, but concept is the same) https://community.creatio.com/questions/office365-oauth-mailbox-synchronisation
Then, with the mailbox added, you can simply use the process Email element and do it all with no code.
Ryan
so do i need to use script task in the business process aswell or do i configure based on Mailjet, since i have 0 clue on how to handle this in creatio, and also what to write in the script task if i am going to use it
Ryan Farley,
so do i use the Send Email process or the script task process to take in parameters, output a to email, get the from email from smtp and build a body and subject through parameters taken from other fields?
Michael Fernando Handoyo,
It's easier to use the "Send email" process element since you can select a mailbox there to be used for sending (and this mailbox should be synced in the Creatio application (and this sync is also needed even if sending an email from the script task)) and also fetch needed values from a record to use them in the email subject or body. See the description of the element here.
Michael Fernando Handoyo,
As Oleg mentioned, typically you'll use the Send email process element. It's very easy to add values into the email body from data. Sending email via code is something I don't often do except for very rare/outlier situations.
Basically, (1) you'll add the mailbox in Creatio and then (2) Use Send email element in the process and select the mailbox to use for the send. (See links shared by Oleg)
Oleg Drobina,
okay so according to the process this is as far as i was able to do it
and this is also the SMTP server that i am using where do i need to insert the password for it? and do i use the server address as my own gmail address or like Creatio@Gmail.com or was it Creatio@domain.com ? please guide me through this
Michael Fernando Handoyo,
You need to use this article for connecting your Gmail mailbox to the application. Only once the mailbox is synced into the Creatio application you will be able to use this mailbox in the business process "Send email" element.