Skip to content

Include File Attachments in Microsoft Graph Emails#8912

Merged
sanjacornelius merged 1 commit into
epic/FOUR-32115from
observation/FOUR-32274
Jul 17, 2026
Merged

Include File Attachments in Microsoft Graph Emails#8912
sanjacornelius merged 1 commit into
epic/FOUR-32115from
observation/FOUR-32274

Conversation

@sanjacornelius

@sanjacornelius sanjacornelius commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

This PR resolves an issue where emails sent using the Microsoft Graph mail driver did not include file attachments.

The solution adds support for converting Symfony Email attachments into Microsoft Graph fileAttachment objects and includes them in the sendMail payload.

Solution

  • Added convertAttachments() to MicrosoftGraphMessageConverter.
  • Maps Symfony Email attachments to Microsoft Graph fileAttachment objects.
  • Includes the following attachment properties in the Graph payload:
    - name
    - contentType
    - contentBytes (Base64 encoded)
  • Updated toSendMailPayload() to include attachments when they are present on the email.

How to Test

  1. Create an Email Server using the Microsoft Graph driver.
  2. Create a process with the following flow:
    - Start Event
    - File Upload Task
    - Send Email Connector
  3. Configure the Send Email connector to use the Microsoft Graph Email Server.
  4. Configure the attachment to use the file upload variable from the File Upload Task.
  5. Save and run the process.
  6. Verify the received email contains the uploaded file as an attachment.

Related Tickets & Packages

ci:connector-send-email:epic/FOUR-32115
ci:deploy

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

Add convertAttachments() to MicrosoftGraphMessageConverter to map Symfony Email attachments to Microsoft Graph fileAttachment objects (name, contentType, contentBytes base64) and include them in toSendMailPayload when present.
@processmaker-sonarqube

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube

@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://ci-f662c9a297.engk8s.processmaker.net

@sanjacornelius
sanjacornelius merged commit 9932295 into epic/FOUR-32115 Jul 17, 2026
10 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants