Invitation message HTML encodes event varriables
djinn23 - May 16, 2009 - 04:44
| Project: | RSVP |
| Version: | 6.x-2.0-rc1 |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hello. I am attempting to use this on a site I am building for a wedding. I have played in several versions. Presently I am using 6.x-2.0-rc1 (simply awesome). The issue I am running into is 2 fold:
1) The invitation email sends HTML encoded characters for the varriables set. for example the default email subject is "[@site] Invitation - @invitation_subject" and my site name is "Laura & Jason's Wedding".
The following is the result of the email sent:
[Laura & Jason's Wedding] Invitation - this is the event: this is an RSVP2) Although I was able to send HTML code in the body of my email with the RSVP version I was using in Drupal 5. . .I have not gotten the trick on this one yet.
Any help would be appreciated.
T Hanks in advanced for any suggestions!
J

#1
Ok so I think I know what one of my issues relates to . It seems other modules have experienced this encoding issue when using the @ symbol to specify the variable.
This seems like something that could be investigated to improve the project.
I am referencing the following:
http://drupal.org/node/176088
http://drupal.org/node/142488
**Edit**
Further investigation and testing my theory
________________________________
Ok so I wanted to test my theory . . .so I did so by editing the "rsvp.mailer.inc" file and changing the parms noted in the following excerpt:
function rsvp_mailer_replacements($rsvp, $invite_target, $sender_name, $message_subject, $message_body) {
$replacements = array(
'@site' => variable_get('site_name', 'Drupal'),
'@site_url' => $GLOBALS['base_url'],
'@invitation_link' => url("rsvp/email/{$invite_target->hash}/view", array('absolute'=>true)),
'@event_link' => url("node/{$rsvp->nid}", array('absolute'=>true)),
'@sender_name' => check_plain($sender_name),
'@message_subject' => check_plain($message_subject),
'@message_body' => drupal_html_to_text($message_body),
);
I did a find and replace on all instances of these in this file and changed them to read like this:
function rsvp_mailer_replacements($rsvp, $invite_target, $sender_name, $message_subject, $message_body) {
$replacements = array(
'!site' => variable_get('site_name', 'Drupal'),
'!site_url' => $GLOBALS['base_url'],
'!invitation_link' => url("rsvp/email/{$invite_target->hash}/view", array('absolute'=>true)),
'!event_link' => url("node/{$rsvp->nid}", array('absolute'=>true)),
'!sender_name' => check_plain($sender_name),
'!message_subject' => check_plain($message_subject),
'!message_body' => drupal_html_to_text($message_body),
);
Changing the settings for the messages to read with the new variable worked (I will have to find where the page tells you what variables you can use to change what it actually says)
<< update of my update>>
The variables mentioned immediately above automagically changed and pointed me to other variables in the same file that needed to be modified too!!
<>
This seemed to work for my messages. I am sure there is a more elegant way but like I previously said. . .I am scary in my edits. I also do not see where the t() is called in this file but I am assuming that it is in another that is calling this file.
I still am having issues sending more than a plain email and realize I should probably search a little more but if anyone has any pointers I am all ears. The theme enhancements mentioned below seem for the drupal invitations only and not the messages.
_______________end edit ________________________
I also took another look at the handbook and see the section entitled "Theme enhancements." I am assuming that this is intended rather than HTML emails. . .I can see it as being more handy.
maybe I should change this to a bug report. . .. sorry for the crazy comments
I could try to hack around but I know enough to be dangerous and end up screwing up more than i fix in ways that I could never understand.
Thanks again.
J
#2
#3
Thank you for reporting. I found the issues and fixed it in the last dev build.
@message_body' => drupal_html_to_text($message_body),However, as you can see from the code above right now the emails are being send as text emails and not in html.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.