Hello,

I had a request to include the Start Date in the email message of the invitation.

After a bit of playing I managed to get this going, but would like confirmation that the code is okay, in rsvp.mailer.inc - rsvp_mailer_replacements

...
function rsvp_mailer_replacements($rsvp, $invite_target, $sender_name, $message_subject, $message_body) {

  $connector = new RsvpConnector();
  $node = rsvp_function_load_node($rsvp);
  $field = $connector->get_event_field($node->type);
  $pos = $connector->get_posByHash($node, $field, $rsvp->startdate );
  if ($pos >= 0) {
    $startdate = $connector->get_startdateAsString($node, $field, $pos);
  }
  else {
    $startdate = $rsvp->startdate; 
  }

  $replacements = array(
    '@site'                     => variable_get('site_name', 'Drupal'),
    '@site_url'                 => $GLOBALS['base_url'],
    '@startdate'                => $startdate,
...

Thanks

Mark

Comments

ulf1’s picture

Status: Active » Closed (fixed)

The code looks good to me. This is the general process on how to extract the invitation start date from a node.

Thanks,
Ulf

Mark_Watson27’s picture

Thanks for the confirmation @Ulf.
Any chance of rolling it in to latest dev?
I'm also working on adding an iCal attachment to the invite so people can automatically add it to their calendar, but will post seperatly on this.

Thanks for all your good work
Mark

mstef’s picture

@Mark: Got a patch for this issue? Got a patch for the ical?