7.10.5 - How to send an email in hook method?

Hello!

I need to send an email with an .ics file (calendar invitation) after creating a task to the assigned user.

I’ve tried to use workflows and the send email action, but SuiteCRM puts lots of controls in the email besides the text I am trying so send (yes, I check the send plain text option).

Using a meeting instead of a task is not an option.

Does anyone know how to do it? I am reading and understanding the meeting logic for sending invitation, but so far I only got frustrated.

Thanks in advance,

SuiteCRM includes phpMailer, just use it directly from the hook, and you will get complete control.

You have all the examples you might need here

https://github.com/PHPMailer/PHPMailer/tree/master/examples

start by trying it with the SugarPHPMailer class, like here

https://github.com/salesagility/SuiteCRM/blob/bb0f2ddb22921d7301abb82a3735d015c8422327/modules/AOP_Case_Updates/CaseUpdatesHook.php#L361

Tks a lot, pgr!