I would like to have the subscription e-mails customized within the subscriptions module such as other modules do (even the user module in drupal core, or the upcoming organic groups module and others) simply be having text fiels for subject and message body for each message type.

This would remove also the requirement of the mail_edit module which is not in sight for drupal 6.

Comments

salvis’s picture

I tend to lean in that direction, but the maintainer of mail_edit intends to make wonderful. He posted a snapshot today, but I won't be able to look into this for the next three weeks.

Mail Editor also has a second function, namely bridging over to Privatemsg, so that Subscriptions notifications can be routed into the user's private message folder. This is useful functionality that would be hard to implement separately. Also, for D6, multi-language support is a must. Doing this in one dedicated module does make sense...

grn’s picture

Can you please specify where the mail content is hardcoded? My users would like to have the subscriptions mail notification in danish.

Thanks :-)

salvis’s picture

It's in subscriptions_mail.templates.inc.

Be careful not to disturb the quotes and newlines!

EDIT: I meant to say "braces and newlines", with braces meaning the conditional syntax.

grn’s picture

Thanks.

FrankT’s picture

Status: Active » Fixed
FrankT’s picture

Status: Fixed » Closed (fixed)
mrtoner’s picture

Status: Closed (fixed) » Postponed

I wouldn't call this issue "fixed," as it's a feature request that hasn't been implemented. Setting to "postponed" until salvis indicates which direction he's going to take.

salvis, how goes the compatibility with Mail Editor? There have been several updates to Subscriptions lately without the necessary hooks (mail_edit_text and mail_edit_tokens_list, among others) for Mail Editor. I'm not really excited about editing subscriptions_mail.templates.inc to get my notifications looking like I want.

salvis’s picture

Status: Postponed » Active

I was waiting for #286315: Please provide an API documentation... (which the mail_edit maintainer instructed me to create...), but as it happens, we talked yesterday night on IRC. I will try to use mail_edit for the template editing chores.

However, it does not support conditional text nor can it return assembled messages for inclusion in a digest, so I probably cannot use it for actual mail processing.

grn’s picture

My problem is with the domain from where the subscription comes from (LAN IP versus WAN IP).

I tried to fix this by replacing as follows:

Edit subscriptions_mail.module on line 258.

Replace ”localhost” with WAN IP (83.xx.xx.xxx).: if (empty($_POST) && (substr($url, 0, 8) == 'http:///' || substr($url, 0, 17) == 'http://83.xx.xx.xxx/')) {

This works sometimes, but I find it unreliable. Any hints?

This could be out of topic please redirect me :)

salvis’s picture

Changing that if doesn't do anything. That if serves only to display a warning message when the Drupal installation returns an odd url which would make the sent out links invalid. The functionality is not changed.

There's no way you can change the sender IP — it's the IP of the host where your web server runs. However, you can change the email address (including host name) that's used for sending out the notifications. Look near the bottom of admin/settings/subscriptions.

grn’s picture

Hmmm okay... is it possible for me to override the link which is sent with the subscription digest:

Link: http://LOCALHOST(LAN IP)/cms/index.php?q=node/87

TO

Link: http://WAN IP/cms/index.php?q=node/87

Is there a smart way to do this?

subscription format
| Link: http://LOCALHOST/cms/index.php?q=node/87
| Direct unsubscribe link (category):
| http://LOCALHOST/cms/index.php?q=s/del/node/tid/13/-1/1/48e6bfb2adce599c...
| --------------------------------------------------------------------
| This is an automated message. Please do NOT reply to the sender address!
| To manage your subscriptions go to
| http://LOCALHOST/cms/index.php?q=user/1/subscriptions

All the LOCALHOST's should be changed. Sorry if I didn't explain it quite good enough.

salvis’s picture

You can set the site URL in settings.php, but this is a global setting for the entire site, not just for Subscriptions.

grn’s picture

Thanks. I will try this solution.

salvis’s picture

Status: Active » Fixed

I went the Mail Editor way after all. It provides a nice interface for editing templates in multiple languages, and reimplementing this would have been a pity, even if Subscription needs to do the actual filling in of the templates itself.

With BETA2, if you have mail_edit 6.x-1.x-dev installed, then you can edit the templates. It's listed as a recommendation, not as a requirement.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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