• Resolved flyken

    (@flyken)


    Hi Nate, thank you for this plugin…it’s fantastic!
    I would like to know if is possible to embed some html code in notification emails in order to use the schema.org murkup for restaurant reservation…
    I would like to add in the confirmation email this kind of code:

    <div itemscope itemtype=”https://schema.org/FoodEstablishmentReservation”&gt;
    <meta itemprop=”reservationNumber” content=”C1″/>
    <link itemprop=”reservationStatus” href=”https://schema.org/Confirmed”/&gt;
    <div itemprop=”underName” itemscope itemtype=”https://schema.org/Person”&gt;
    <meta itemprop=”name” content=”{user_name}”/>
    </div>
    <div itemprop=”reservationFor” itemscope itemtype=”https://schema.org/FoodEstablishment”&gt;
    <meta itemprop=”name” content=”MyRestaurant”/>
    <div itemprop=”address” itemscope itemtype=”https://schema.org/PostalAddress”&gt;
    <meta itemprop=”streetAddress” content=”Via Donati, 1″/>
    <meta itemprop=”addressLocality” content=”Torino”/>
    <meta itemprop=”addressRegion” content=”TO”/>
    <meta itemprop=”postalCode” content=”10121″/>
    <meta itemprop=”addressCountry” content=”Italy”/>
    </div>
    <meta itemprop=”telephone” content=”+39 011545405″/>
    </div>
    <meta itemprop=”startTime” content=”{date}”/>
    <meta itemprop=”partySize” content=”{party}”/>
    </div>

    Would be great if you could implemet it in the next versions of your plugin…but in the meanwhile I would just be able to add this to the notification email…

    I’m using a plugin to output the php mail in html but if I try to add the code in the Notification settings window, when I save, all the text disappears exept for all the <div> tags.

    Could you help??

    Thank you!

    https://www.ads-software.com/plugins/restaurant-reservations/

Viewing 1 replies (of 1 total)
  • Hi flyken,

    Probably the best way to do this would be to add a custom template tag that outputs this information. This gist demonstrates how to add a template tag {address} that adds My Address to an email when used in the notification template.

    You’ll notice that a $notification variable is passed to that filter. You can find all the related bookings details in $notification->booking, so you can return your HTML code with all the details for a tag like {booking-schema}.

    If you want to force it rather than including it in a template tag, you can always filter the notification email template itself. Every time a setting is accessed it is passed through a filter, rtb-setting-{setting-slug}. So the admin notification template, which has a setting slug of template-booking-admin, can be filtered with rtb-setting-template-booking-admin.

    You can use that to completely override the template and add whatever you’d like.

Viewing 1 replies (of 1 total)
  • The topic ‘Schema.org in notification emails’ is closed to new replies.