I would very much like to be able to customize the email message that is sent out. (without hacking the code)

Comments

mindless’s picture

The email content is themable. Create yourtheme_subscriptions_mail_item_body (or _subject or _headers) function in your theme.

drunkenbird’s picture

ok, well what I meant is that it would be nice if the message was configurable through the subscription settings page, especially for the drupal users that don't wish or for that matter, have much of a clue how to write code.

From a coding perspective though, It doesn't seem to me that the configuration of an email message should belong to a particular theme. I could see using that if you wanted to send out html'ized emails, but the actual message, IMHO, should not be dependent on theming code.

Anyway, just my 2 cents, thanks for replying.

mindless’s picture

Both good points.. a simple textbox in settings could be sufficient for many people, and the only option for non-coders. Also it's likely only html emails would look like a "themed" email.
The main reason I added the themable content is the customized content for my site has additional logic.. an admin setting to change the text would not do it.
I think both options can work together though.. an admin setting with a note below it saying it's possible for a theme to override that setting.

liquidcms’s picture

i think this will do it.

liquidcms’s picture

StatusFileSize
new3.35 KB

i think this will do it.

mindless’s picture

Assigned: Unassigned » mindless
Status: Active » Fixed

Thanks! The patch seems based on older code, but I merged it into the DRUPAL-4-7 and DRUPAL-5 branches. I also added the current text as the default settings values.

liquidcms’s picture

Version: 5.x-1.9 » 4.7.x-1.x-dev

not sure how well this patch works that i submitted... doesn't take body token into account properly when a comment is posted and would be better to give "real" content type names for cck types rather than content_my_type.

so i have made a new patch that fixes up some of these things; but not sure how generic it is... could post it if anyone is interested.

jarea’s picture

I am interested in the new patch if you post it.

Thanks for the help - jarea

liquidcms’s picture

StatusFileSize
new20.94 KB

ok, hope this works and helps.

jarea’s picture

StatusFileSize
new22.81 KB

Thanks but 16 out of 22 hunks failed. Here is the reject file if that helps.

Applied against subscriptions.module,v 1.62.2.38 2007/03/09 21:19:49 mindless Exp $

Anonymous’s picture

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

sorry, such question: can we hope for a 2.0 version soon where this functionality is implemented? when can this happen?

Dimm’s picture

+1

grege’s picture

Hi, I also want to configure the subscription email message, but because it does not have a tidy login management. People are getting the Access Denied message.

If I am auto-logged in it will take me to the post, but will not bring up the login if I'm not.

Not familiar with this coding in the module, how do I get it to ask for login in one link and not for another?
http://www.xxx.yyy/user/login?destination=node/75 ...does prompt for login then take you there, but balks if you ARE logged in already!

I'm very surprised this is not all part of the standard, I'd expect it to ask if needed, not if it doesnt... Or am I missing something?

Tks, Greg E

salvis’s picture

#14: Indeed, Drupal 5.x does this automatically. It's not part of the functionality of the Subscriptions module.

grege’s picture

Thanks for the reply Salvis, but can you be more specific - I'm not clear where I go from here.
Maybe I need to be more specific too!, so here is the problem in greater detail...

This is a very recent V5.x.1.9 install, so the code is only a few weeks old, should have all the current bits in it.

Subscriptions module is the one from Drupal as well, same version as far as I can tell, (the .info files have 2 versions mentioned, not sure which is the real one, I'm assuming the latter number.)

So:
- when you try this on your forums
1. Open browser go to forum website www.xxx.yyy.zzz and Log out from Drupal (to simulate a user not logged in)

2. Close browser

3. Open an email with a a link to a forum topic like the subs module creates
http://www.xxx.yyy.zzz/node/80

do you get access denied, or a login prompt ? I get access denied. Not handy for not-so-IT-savvy people people I am trying to persuade to use my forum! Also some may be using quite old systems and browsers and I cant assume they have a browser thats the latest revision, could be Win 95 or 98, browser, 5yrs or older.

If the subs module sent
http://www.cmc.net.nz/user/login?destination=node/75
This will prompt for a login, but fails if you have NOT logged out.

What I want is either
-2 links in the subs created email, (and I need to figure how to code that)
Or
-a way for it to work as above where irrespective of your last state of login, it asks for a login if needed, but works if you are logged in.

Help would be greatly appreciated!
Thanks , Greg

salvis’s picture

I see — you should have opened a new thread. This thread is about the Subscriptions version that goes with Drupal 4.7, and that made me think you were using an old version of Drupal.

Apparently, you're also using some kind of access control module that protects your content from anonymous users. I happen to use Forum Access for protecting forums, and my setup works naturally the way you described, to the point where I thought it was built-in functionality. But, indeed, it requires some configuration steps:

  1. I hate having that ugly login block on my front page, so I install the Login Menu module. It creates a "Login" menu item for anonymous users. (This is not really necessary.)
  2. Create your own "Access denied" page.
  3. I enable the Path core module, go to admin/build/path and give that page an alias of "403" — you can call it whatever you like, or even just use node/123 below (whatever number you get).
  4. Go to admin/settings/error-reporting and set the Default 403 (access denied) page to your "Access denied" page. (For me, this is "403", without the quotes.)
  5. Finally go to admin/build/block, check that the "User login" block is enabled where you want to have it (I usually put it into the right sidebar, which is empty otherwise), click the block's configure link, activate Show on only the listed pages, and enter the path of your "Access denied" page into the edit field. (For me, this is "403", without the quotes.)
  6. If you don't use the Login Menu module, you may want to enable the Login block on your front page as well, which is typically "node", or whatever you specified as Default front page on admin/settings/site-information.

This should do what you want. Please open a new issue in the future, unless you're really adding information specifically to an existing issue.

grege’s picture

Version: 4.7.x-1.x-dev » 5.x-1.9
Category: feature » support
Priority: Normal » Minor

Thanks, well I couldn't tell where the login problem was, so was looking to customise the email... And this issue matched perfectly!

It does seem to have come right with just setting the 403 access denied to xxx.yyy.zzz/users/login?
Didn't do any of the other bits, think it is OK now. So I guess it was the Drupal login not happening, not subscriptions.
Ta for your help, Greg

salvis’s picture

Version: 5.x-1.9 » 4.7.x-1.x-dev
Category: support » feature
Priority: Minor » Normal

Glad to help.

shawnc’s picture

If I understand correctly, a code-free solution for customizing the content/appearance of the outgoing subscription notification email is still in the works and not yet available. In the meantime, could anyone tell me what I would need to change in the code in order to include the username of the commenter in the body of the email message that gets sent?

The code makes reference to a number of variables, such as @name, @type, !url, etc. Is it just as simple as adding a similar variable reference in the body message for @[name_of_commenter]?

Thanks in advance.

gustav’s picture

Shawnc, the ability to edit the email templates is provided in the 5.x-2.0 version of the subscription module. It uses the mail_edit module to provide this functionality. The 5.x-2.0 version is currently in beta 4, see http://drupal.org/node/198544. Please help testing,