Page 1 of 1

Processmaker 4.3 Community Bitnami Package

Posted: Wed Apr 26, 2023 5:02 am
by Jayson
Hi,

Could you let me know if it's possible to create a script for email notifications after sending a request to the approver using the Processmaker 4.3 Community Bitnami Package?

If possible could you help me with how to configure in Process Modeler Designer and what is the script?

Thank you in advance.

Re: Processmaker 4.3 Community Bitnami Package

Posted: Thu Apr 27, 2023 2:35 pm
by ayodelebamgboye
Log in to the Processmaker 4.3 Community Bitnami Package with your credentials.
Go to the Processmaker Designer and select the process where you want to add the email notification.
Select the task where you want to add the email notification.
Click on the "Notifications" tab and select the "Email" notification type.
In the "To" field, select the user or group who should receive the email notification.
In the "Subject" and "Message" fields, enter the content of the email notification.
Click on the "Advanced" tab and select the "Script" option.
In the "Script" field, enter the code to send the email notification. You can use PHP's built-in mail function or a third-party email library such as PHPMailer to send the email.

require_once 'vendor/autoload.php';

// Create a new PHPMailer instance
$mail = new PHPMailer\PHPMailer\PHPMailer();

// Set the SMTP configuration
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = 'your-email@gmail.com';
$mail->Password = 'your-password';

// Set the email content
$mail->setFrom('your-email@gmail.com', 'Your Name');
$mail->addAddress('recipient-email@example.com', 'Recipient Name');
$mail->Subject = 'Notification: Your request is waiting for approval';
$mail->Body = 'Dear Recipient, your request is waiting for approval.';

// Send the email
if (!$mail->send()) {
throw new Exception('Error sending email: ' . $mail->ErrorInfo);
}
Note that you need to install the PHPMailer library using Composer or download it manually and include the autoload.php file at the beginning of your script.

Re: Processmaker 4.3 Community Bitnami Package

Posted: Fri Apr 28, 2023 9:48 pm
by Jayson
Hello @ayodelebamgboye

Thank you for your response. I followed the steps you provided to add the "Email" notification type in the Notifications tab, but unfortunately, the option is still not available.

Please refer to the screenshot

https://imgtr.ee/images/2023/04/28/JlvCL.jpg


Thank you

Re: Processmaker 4.3 Community Bitnami Package

Posted: Fri Apr 28, 2023 9:50 pm
by Jayson
Hello @ayodelebamgboye

Thank you for your response. I followed the steps you provided to add the "Email" notification type in the Notifications tab, but unfortunately, the option is still not available.

Please refer to the screenshot

Image

Thank you