I'm using mail_edit 5.x-1.1, this patch is critical for subscriptions_og.

Blessings!

CommentFileSizeAuthor
subscriptions_mail.module.patch1.24 KBdevelcuy

Comments

salvis’s picture

Are you sure that subscriptions_mail_cron() doesn't load the mail_edit templates afterwards?

I'm quite unhappy with this part of the code and I've complained about it to chx a few times, but it's how it is: subscriptions_cron() fills in the default templates and tries to send them, and only then will mail_edit jump in an retrieve the mail_edit templates, get them filled in, and send the result.

Please verify that your patch really makes a difference for subscriptions_og — I think it doesn't...

develcuy’s picture

I'm unhappy with that part of code too, because it seems that subscriptions_mail_cron() retrieves mail_edit templates only for digest notifications, but for normal, $subject_template and $body_template have value from variable_get('subscriptions_email_subject', SUBSCRIPTIONS_DEFAULT_SUBJECT) and variable_get('subscriptions_email_body', SUBSCRIPTIONS_DEFAULT_BODY). Then $subject and $body are pre-processed BEFORE _subscriptions_mail_send() is called.
Since function _subscriptions_mail_send() calls to drupal_mail() and this one then calls mail_edit_hook_alter(), $body and $subject never got a chance to be parsed with their right template because they were previously preprocessed.
Finally, I've been testing this bug yesterday with every template available for subscriptions:
subscriptions-node-nid
subscriptions-node-tid
subscriptions-node-type-blog
subscriptions-node-type-book
subscriptions-node-type-group
subscriptions-node-type-group2
subscriptions-node-type-page
subscriptions-node-type-story

No one works.

Subscriptions_og provides a new mailkey via hook_mailkeys(), it is: subscriptions-node-group_nid.

Hope this help.

Blessings!

salvis’s picture

I'm sorry for being dense, but what is it exactly that doesn't work? Please give me one specific way to reproduce the misbehavior:
-- what to do?
-- what you expect to see?
-- what happens instead?

develcuy’s picture

Priority: Critical » Minor
Status: Needs review » Closed (fixed)

I've tested it again in a fresh installation, works perfectly without patches, the same in subscriptions_org demo site with beta11.
I'm sorry, this is not a bug, sure I miss-configured something.

Blessings!

salvis’s picture

Assigned: develcuy » Unassigned

Ok, thank you for double-checking!