In ProcessMaker, you can obtain the path of an uploaded file in a Dynaform and then use that information to send an email.
Here's how you might accomplish that:
Step 1: Obtain the Path of the Uploaded File
In a trigger, you can use the following code to get the path of the uploaded file. Assume the ID of the file control in the Dynaform is "fileControlId":
php
Code: Select all$fileControlId = @@fileControlId;
if (!empty($fileControlId)) {
$fileInfo = G::getUploadedFile($fileControlId);
$filePath = $fileInfo['stored_file_path'];
}
Step 2: Send the Email with the File Path
You can then use the $filePath variable to send an email. Here's a basic example of how you might send an email using ProcessMaker's PMFSendMessage function:
php
Code: Select all$emailTo = "recipient@example.com";
$subject = "Uploaded File Path";
$body = "The path to the uploaded file is: $filePath";
PMFSendMessage(@@APPLICATION, $emailTo, '', '', $subject, $body);
Make sure to replace "recipient@example.com" with the actual recipient's email address.
Note
Ensure that the file control's ID matches what you use in the code.
Be cautious about sending file paths in an email, especially if the recipient is outside your organization. File paths can sometimes contain sensitive information or reveal details about your system's structure.
This code should be run as part of a trigger that is fired after the Dynaform with the file upload is submitted. Check the ProcessMaker documentation for your specific version to make sure these functions and methodologies apply.