I created a custom EmailWebformHandler handler, despite putting inside the sendMessage method $message['attachments'] = drupal_realpath('private://sample.pdf'); the e-mail did not contain my attachment.
Looking at hook_mail and hook_mail_alter I could not find $message['attachments']
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | 2983707-18.patch | 4.04 KB | rpayanm |
| #2 | sendgrid_integration-2983707-2.patch | 1.9 KB | jrockowitz |
Comments
Comment #2
jrockowitz commentedComment #3
perignon commentedThanks for the patch!
Comment #5
no sssweat commentedI put the patch inside the sendgrid_integration module folder.
when I try
git apply -v sendgrid_integration-2983707-2.patchI'm getting:
I am applying the patch against the latest dev version. Also, tried applying it to the latest stable version, but same result.
Comment #6
no sssweat commentedComment #7
no sssweat commentedNever mind, turns out the patch has already been committed to the latest dev. Thus, I was trying to apply a patch that was already applied.
Also, it's was my first time using windows patch command which doesn't tell you anything when it gets applied, so turns out my stable version also already was patched.
Comment #8
no sssweat commentedI'm getting a weird error
But I see the
use SendGrid\Client;at the top. What the...Comment #9
no sssweat commentedComment #10
no sssweat commentedOh I see now, I now remember my client did not want to use composer, so I had to patch this. Which explains why the patch was failing to apply on stable.
Comment #11
no sssweat commented@jrockowitz did you remember to remove the form alter that you added to webform.module on sendgrid integration's behave?
Because when I remove it, I no longer get attachments on the e-mail, so seems like the #2 patch is not working.
Comment #12
perignon commentedThe patch did not apply because it has already been committed against the branch if you are using the latest dev.
Not use composer with D8? Good luck! I cannot seem to get around composer and do everything command line like I did in D7 days.
Comment #13
no sssweat commented@Perignon, I normally would use composer, but since we're using Pantheon, using composer would destroy the 1 click updates feature, which my client wants to have.
Luckly, this is the only module that we need that relies on composer, so we'll be fine.
Comment #14
ruslan piskarov@No Sssweat,
On Pantheon you can use "terminus composer YOU-SERVER-NAME.dev require drupal/sendgrid_integration".
Comment #15
ruslan piskarovI tested the patch and works great. Moving to Fixed as the patch was committed to dev.
Comment #17
rpayanmThe keys
filepathandfileinside the$attachmentvar do not exist anymore.Comment #18
rpayanmThis patch fixed that.
Comment #19
ruslan piskarovHey @rpayanm. This issue was closed 2 years ago. I think you can create a new one.
Comment #20
nicholass#18 @rpayanm worked for me locally(DDEV), but for some reason it doesn't on our Acquia servers. Any ideas why?
I am wondering if it has something to do if the webform attachments are private files, would that be why they are not being sent via sendgrid?
Comment #21
nicholassSo it turns out my issue was also related to this webforms issues related to memecache for anyone else having trouble with attachments. Downgrading to memcache 2.1 did the trick, and that explains why attachments worked on my local.
https://www.drupal.org/project/memcache/issues/3176519
So patch #18 does in fact work! Thanks!