Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, we're moving to Drupal and have been using Sendgrid for many months now (and love it!). We currently use categories and I'm hoping there's a way to do that with Drupal. The only place I see categories being used is for the site name. We have categories like: workshop invitation, certificate, confirmation. Most emails have a second category for the program type (client has online and live meetings).
I'm a developer, though I haven't developed for Drupal yet.
Thanks,
Jay
Comment | File | Size | Author |
---|---|---|---|
#9 | sendgrid_integration-allow-modification-of-categories-2604524.patch | 1.35 KB | hailong |
Comments
Comment #2
JayLevine CreditAttribution: JayLevine commentedComment #3
Perignon CreditAttribution: Perignon commentedHi Jay,
They are supported from an API perspective of course. The rewrite of the module (which isn't here on Drupal yet) has the categories hard coded into it. That could easily be changed.
So the module rewrite you can see here on my Github account: https://github.com/taz77/drupal-sendgrid_integration
It is a major rewrite of the module and it also includes dependencies on a forked version of the Sendgrid API that I wrote (and composer). I am going to get my fork of their API into Packagist soon so that it can be called normally in Composer. At the moment Sendgrid does not want to maintain a second version of their API.
Comment #4
Perignon CreditAttribution: Perignon commentedOh and I agree with you. I love Sendgrid so far. I tried 4 other transactional email services and Sendgrid has the best penetration into an inbox so far.
Comment #5
JayLevine CreditAttribution: JayLevine commentedHi Perignon,
I saw the conversation between you and the Sendgrid developer about updating the guzzle (?) libraries.
Since I have no Drupal dev experience, my question is how the categories would get to the Sendgrid module. Is there a logical place to put them, data that the module gets or can see? Or would there need to be a separate table for some kind of lookup (or am I off base here)?
I guess I got lucky with Sendgrid. I use DNS Made Easy, they partner with Sendgrid, so a little more research and they looked like a good choice. The only negative is, for my 1 support request, took them a day and the support person clearly hadn't read my whole request, luckily it wasn't urgent.
Thanks,
Jay
Comment #6
Perignon CreditAttribution: Perignon commentedHi Jay,
Yeah, I am using Guzzle 6.x because Guzzle 6.x is also incorporated into Drupal 8. It also implements PSR 7 requests. Guzzle has become the defacto PHP library for HTTP requests.
The categories would have to be configurable. In my rewrite of the module, the categories are based on the internal workings of Drupal.
Catagories are this:
Site -> module -> function
The reason for this is because it allows you to see what sent the email internally in Drupal and from what website if you are using the same Sendgrid account across multiple sites.
And example of the category would be:
My cool website, user, user_password_reset
This would tell you that "My cool website" had someone that requested a user password reset for their account.
What we would need to do is provide an alter to this that allows custom modules to alter the data going into the categories. Alters are a special thing in Drupal that allows a modules internal data to be modified without someone hacking the module.
Yup, sounds greek - I know. Learn Drupal and you will love it if you are a dev. Drupal is extremely powerful, but it takes work to learn it before you can really make use of the flexibility it gives you.
Comment #7
Perignon CreditAttribution: Perignon commentedOh and I got off my tush and finished the Packagist package: https://packagist.org/packages/fastglass/sendgrid
Comment #8
Perignon CreditAttribution: Perignon commentedAnd now builds are failing on TravisCI. I will have to look at that later, it is late where I am so till tomorrow!
Comment #9
hailong CreditAttribution: hailong as a volunteer commentedAdd hook function to allow modification of categories.
Comment #10
Perignon CreditAttribution: Perignon commentedAwesome! Thanks for the patch!
Comment #11
Perignon CreditAttribution: Perignon commentedD.O. robot seems to have failed. This is already committed.
Comment #12
Perignon CreditAttribution: Perignon commented