Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By Jayson
#830535
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.
#830546
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.
#830552
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
#830553
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
Nursing dissertation help topics

Welcome to the Nursing Dissertation Hub, your go-t[…]

A Dream11 clone script is a pre-made software solu[…]

A stake clone script is a pre-designed, error-free[…]

The Aviator casino game script clone script replic[…]