How can i sent e-mail from espo using API ?
Announcement
Collapse
No announcement yet.
Sent e-mail using API
Collapse
X
-
I did understand. You could see this, if you opened browser console.
$postFields = json_encode(array(
"assignedUserId" => "1",
"body" => "<p>text3</p>",
"bodyPlain" => "text",
"isHtml" => true,
"status" => "Sending",
"subject" => "sub3",
"from" => emailFrom,
"to" => emailTo
));
$url = $espoUrl . "/api/v1/Email";
$httpMethod = "POST";
Comment
-
Hi Tanya, I have a couple of related questions:
1) How do you set the fromName with this approach? I tried doing something like from = "Some Name <email@example.com>" which is a valid email string for other libraries I've worked with but that choked, and I also tried passing a fromName param but it doesn't seem to get used.
2) Is there a way to queue up multiple emails without sending, and then trigger them being sent in bulk? I thought maybe I could put them in some other status first and then do a bunch of updates to status = "Sending" but I think that would still behave in a synchronous manner since it looks like there is a status check in a function that runs after the update.
Thanks.
Comment
-
Hi Kurt,
1) fromName is defined in CRM (in SMTP configuration or User Name). You can set only 'from' in parameters
EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.
EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.
2) no, this feature is not implemented. You can add checkbox in Entity Manager (like email is ready to send), save Emails as draft, and develop a job for sending ready emails
Example
EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.
EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.
Comment
-
For #1, I set the From Name in the Outbound Emails configuration so when the System user sends email it uses the From Name that I'm aiming for. Is there a way that I can send Emails via API that get sent out by the System user instead of the User that created the Email record? For example I'm accessing the API as Admin to create Emails so the From Name shows up as "Admin", but I'd like it to just send as the system somehow.
Thanks for your help.
Comment
Comment