In my confirmation mail to people who make a reservation I would very much like to put both the start date and the end date. According to the Token help I have a wealth of Rooms related Tokens available. However, they do not seem to work.
In the message that I send out (with Message Notify) is the following line:

Bedankt voor uw reservering @{message:message-commerce-order:order-number} bij [site:name] van [rooms_booking:start-date] tot [rooms_booking:end-date]. We zien uit naar uw komst! U krijgt: [rooms_unit_type:label]

which 'translates' into:
Bedankt voor uw reservering 96 bij Bed and Breakfast De Oester van [rooms_booking:start-date] tot [rooms_booking:end-date]. We zien uit naar uw komst! U krijgt: [rooms_unit_type:label].

Is this a Rooms issue or related to the other modules involved. I am trying to solve this for two months now and effectively NOT using Rooms for that reason.

Many thanks for your time

Comments

TheoRichel’s picture

Title: Rroms related Tokens are not 'translated' » Rooms related Tokens are not 'translated'
jwilson3’s picture

Title: Rooms related Tokens are not 'translated' » Rooms related Tokens are not processed in email notify (possibly elsewhere?)
Issue summary: View changes

Just clarifying the title, this doesnt have to do with what we normally consider translation (ie i18n, localization), but with token processing.

djevans’s picture

This may be related more to configuration of Message/-Notify, rather than a Rooms-specific issue.

In general, each instance of a 'Message Type' entity needs to have a different Entity Reference field attached for each entity it needs to pull data from. Given the message you posted above, I guess you should have the following fields attached to your Message Type:

  • message_commerce_order, referencing a Commerce Order,
  • rooms_booking, referencing a Bookings,
  • rooms_unit_type, referencing a Bookable Unit Type.

Before you send the message, these fields need to be set. The 'rules_commerce_order_message_order_notification' rule supplied with the commerce_message module is a good place to start if you're using the Rules UI.

Lastly, this may be different as I'm looking at 7.x-1.x-dev, but I need to use the tokens

[message:rooms_booking:start-date] instead of [rooms_booking:start-date] and
[message:rooms_unit_type:label] instead of [rooms_unit_type:label]

(for example) for Rooms-related entities.

TheoRichel’s picture

First: thank you very much!
I have added those fields to the Message Type involved as below:

Label      Systemname                       Fieldtype             Widget
Order	     message_commerce_order     Entity Reference	Autocompl.	
 
BookRef   rooms_booking_reference       Entity Reference	Autocompl.	
Unit	     unit_description_description   Text	          Textfield

Other settings I have not touched.
There is already a rule that sends out this message, so the only thing I then did was change the tokens as you suggested.

It had however no effect, the Tokens are not processed.

jwilson3’s picture

Maybe it would be helpful if you could export the rule you're using and attach it here?

TheoRichel’s picture

Here is the rule I use:

{ "rules_commerce_order_message_order_notification" : {
    "LABEL" : "Commerce order message: order notification e-mail",
    "PLUGIN" : "reaction rule",
    "WEIGHT" : "3",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "message_notify", "commerce_checkout" ],
    "ON" : { "commerce_checkout_complete" : [] },
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "message",
            "param_type" : "commerce_order_order_confirmation",
            "param_user" : [ "commerce-order:owner" ]
          },
          "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
        }
      },
      { "data_set" : {
          "data" : [ "entity-created:message-commerce-order" ],
          "value" : [ "commerce-order" ]
        }
      },
      { "entity_save" : { "data" : [ "entity-created" ], "immediate" : 1 } },
      { "message_notify_process" : {
          "message" : [ "entity-created" ],
          "save_on_fail" : 0,
          "save_on_success" : 0
        }
      }
    ]
  }
}
djevans’s picture

It looks like you need to have a separate 'Set a data value' action in your rule for each field attached to the message entity you've created. Currently you're only setting the Commerce order, so there won't be any values available for the other (Rooms-specific) placeholders in your message.

Could you export the message type you're using and post it here too?

TheoRichel’s picture

Thanks. See the requested message export:

{
  "name" : "commerce_order_order_confirmation",
  "description" : "Bevestiging reservering",
  "argument_keys" : [],
  "argument" : [],
  "category" : "message_type",
  "data" : {
    "token options" : { "clear" : 0 },
    "purge" : { "override" : 0, "enabled" : 0, "quota" : "", "days" : "" }
  },
  "language" : "nl",
  "arguments" : null,
  "message_text" : {
    "en" : [
      {
        "value" : "Order @{message:message-commerce-order:order-number} at [site:name]",
        "format" : null
      },
      {
        "value" : "Thanks for your order @{message:message-commerce-order:order-number} at [site:name].\r\n\r\nIf this is your first order with us, you will receive a separate e-mail with login instructions. You can view your order history with us at any time by logging into our website at:\r\n\r\n[site:login-url]\r\n\r\nYou can find the status of your current order at:\r\n\r\n[message:message-commerce-order:view-url]\r\n\r\nPlease contact us if you have any questions about your order.",
        "format" : "commerce_order_message",
        "safe_value" : "Thanks for your order @{message:message-commerce-order:order-number} at [site:name].\n\nIf this is your first order with us, you will receive a separate e-mail with login instructions. You can view your order history with us at any time by logging into our website at:\n\n[site:login-url]\n\nYou can find the status of your current order at:\n\n[message:message-commerce-order:view-url]\n\nPlease contact us if you have any questions about your order."
      }
    ],
    "nl" : [
      {
        "value" : "\u003Cp\u003EOrder @{message:message-commerce-order:order-number} at [site:name]\u003C\/p\u003E",
        "format" : "full_html"
      },
      {
        "value" : "\u003Cdiv style=\u0022margin-left: 25%; margin-right: 25%; width: 50%; background-color: ffffff\u0027;\u0022\u003E\u003Cp\u003E\u003Cimg src=\u0022\/sites\/default\/files\/sites\/default\/files\/images\/LogoOester3.png\u0022 alt=\u0022Logo de Oester\u0022 title=\u0022Logo de Oester\u0022 style=\u0022vertical-align: middle;\u0022 height=\u0022186\u0022 width=\u0022253\u0022\u003E\u003C\/p\u003E\u003Cp\u003E\u0026nbsp;\u003C\/p\u003E\u003Cp\u003EGeachte gast, [message:user]\u003C\/p\u003E\u003Cp\u003EBedankt voor uw reservering @{message:message-commerce-order:order-number} bij [site:name]. We zien uit naar uw komst!\u003C\/p\u003E\u003Cp\u003EU kunt uw reservering desgewenst ook op onze site bekijken. Daarvoor moet u inloggen op: [site:login-url] . De gegevens daarvoor worden u separaat toegestuurd. Als u die gegevens heeft gaat u naar: [message:message-commerce-order:view-url] .\u003C\/p\u003E\u003Cp\u003EAls dat problemen oplevert, graag even contact opnemen met ons op +(31)113-330030 of +(31) 6 14141715 of info@deoester.nl.\u003C\/p\u003E\u003Cp\u003EWe vinden het prettig als u ons voorafgaand even meldt hoe laat u ongeveer denkt aan te komen.\u003C\/p\u003E\u003Cp\u003EVeel plezier en nogmaals dank voor uw reservering,\u003C\/p\u003E\u003Cp\u003E\u0026nbsp;\u003C\/p\u003E\u003Cp\u003Evriendelijke groet\u003C\/p\u003E\u003Cp\u003E\u0026nbsp;\u003C\/p\u003E\u003Cp\u003ETheo en Jos\u00e9\u003C\/p\u003E\u003Cp\u003EB\u0026amp;B De Oester Yerseke\u003Cbr\u003EDamstraat 19-21\u003Cbr\u003E4401AA Yerseke\u003C\/p\u003E\u003Cp\u003E0113-330030\u003C\/p\u003E\u003Cp\u003E06-14141715\u003C\/p\u003E\u003Cp\u003E\u003Ccode\u003E[message:rooms_booking:start-date]\u0026nbsp; (start date)\u003Cbr\u003E\u003C\/code\u003E\u003C\/p\u003E\u003Cp\u003E\u003Ccode\u003E[message:rooms_unit_type:label]\u0026nbsp; kamertype\u003Cbr\u003E\u003C\/code\u003E\u003C\/p\u003E\u003Cp\u003E\u0026nbsp;\u003C\/p\u003E\u003Cp\u003E\u0026nbsp;\u003C\/p\u003E[message:field-comment-ref:author:edit-url]\u003C\/div\u003E\u003Cdiv style=\u0022margin-left: 25%; margin-right: 25%; width: 50%; background-color: ffffff\u0027;\u0022\u003E\u003Cdiv\u003E\u0026nbsp;\u003C\/div\u003E\u003C\/div\u003E\u003Cp\u003E[message:field-comment-ref:author:validate-url]\u003C\/p\u003E\u003Cp\u003E[message:message-commerce-payment:message]\u003C\/p\u003E",
        "format" : "full_html"
      }
    ],
    "und" : [
      {
        "value" : "Order @{message:message-commerce-order:order-number} at [site:name]",
        "format" : null
      },
      {
        "value" : "Thanks for your order @{message:message-commerce-order:order-number} at [site:name].\r\n\r\nIf this is your first order with us, you will receive a separate e-mail with login instructions. You can view your order history with us at any time by logging into our website at:\r\n\r\n[site:login-url]\r\n\r\nYou can find the status of your current order at:\r\n\r\n[message:message-commerce-order:view-url]\r\n\r\nPlease contact us if you have any questions about your order.",
        "format" : "commerce_order_message",
        "safe_value" : "Thanks for your order @{message:message-commerce-order:order-number} at [site:name].\n\nIf this is your first order with us, you will receive a separate e-mail with login instructions. You can view your order history with us at any time by logging into our website at:\n\n[site:login-url]\n\nYou can find the status of your current order at:\n\n[message:message-commerce-order:view-url]\n\nPlease contact us if you have any questions about your order."
      }
    ]
  },
  "rdf_mapping" : []
}
ronald_istos’s picture

Category: Bug report » Support request

Adding it to support request for now because doesn't look like a Rooms-bug

larose’s picture

Hi all,
does anyone has managed to solve this problem?

papper00’s picture

I could really do with this functionality too. My client has requested room number/name, start/end dates, deposit amount paid, amount outstanding and number of guests to be included within the email.

If anyone figures out how to get those tokens into the email rule please do let me know.