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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JayLevine created an issue. See original summary.

JayLevine’s picture

Issue summary: View changes
Perignon’s picture

Hi 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.

Perignon’s picture

Oh 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.

JayLevine’s picture

Hi 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

Perignon’s picture

Hi 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.

Perignon’s picture

Oh and I got off my tush and finished the Packagist package: https://packagist.org/packages/fastglass/sendgrid

Perignon’s picture

And now builds are failing on TravisCI. I will have to look at that later, it is late where I am so till tomorrow!

hailong’s picture

Add hook function to allow modification of categories.

Perignon’s picture

Awesome! Thanks for the patch!

Perignon’s picture

D.O. robot seems to have failed. This is already committed.

Perignon’s picture

Status: Active » Fixed

  • Perignon committed 397125c on 7.x-1.x authored by hailong
    Issue #2604524 by hailong: Adding Categories to emails
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.