Remove field from submission before emailing #8567
-
I have a custom SendMail class that does some footling to submissions before they are emailed to recipients. This is because the submissions are emailed to our D365 CRM and processed automatically. Our D365 vendor is painfully expensive and slow to engage, so where possible, we need to make the CRM think we're still sending the same data even though we're adding a few fields here and there 💃 This is a basic proof of concept in the handle method: /app/Forms/MySendMail.php
Is there a way to remove the extra field from the Submission before I give it to the Mail::send method? I can remove the extra field at the email template end, but I want to confine this disaster to one spot if possible. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You should be able to do |
Beta Was this translation helpful? Give feedback.
You should be able to do
$submission->remove($key)