Free and Premium WordPress Plugins & Themes Forums WordPress Themes Alpenhouse Express expiration date&time in user Booking Confirmation mail
- This topic has 2 replies, 3 voices, and was last updated 4 years, 10 months ago by Paul MANDL.
- AuthorPosts
- December 18, 2019 at 5:24 pm #897002Van HoveParticipant
Hello
In MotoPress AlpenHouse theme, General Settings, time zone is set to UTC+1 (Brussels time).
The Email sent to the customer after he reserved an accommodation contains an expiration date&time. This is expressed as UTC.Confirm
Note: link expires on December 18, 2019 17:26 UTCIs it possible to make it adjust to our time zone automatically (as most of our guests/customers come out of our own time region).
Thanks
CarineDecember 23, 2019 at 12:51 pm #898466SteveKeymasterHello Van Hove,
You can use a filter to modify any macros in email. To use time zone set in WordPress setting follow these steps.
1. Upload and activate child-theme or create a new plugin for custom code.
2. Add this code to functions.php of your theme or custom pluginfunction mycustom_mphb_email_replace_tag($replaceText, $tag, $booking = null) { if ($tag == 'user_confirm_link_expire' && $booking) { $gmtOffset = (int)(get_option('gmt_offset') * HOUR_IN_SECONDS); $expireTime = $booking->retrieveExpiration('user'); $replaceText = date_i18n(MPHB()->settings()->dateTime()->getDateTimeFormatWP(), $expireTime + $gmtOffset); } return $replaceText; } add_filter('mphb_email_replace_tag', 'mycustom_mphb_email_replace_tag', 10, 3);
3. Remove UTC text from email template.
If you feel difficulties by implementing these changes, you may take advantage of the Extended Support service and contact us with details. We’ll gladly help you.
December 29, 2019 at 3:24 pm #900179Paul MANDLParticipantThanks Steve – works great!
I added the code with https://wordpress.org/plugins/code-snippets/
Cheers, Paul
- This reply was modified 4 years, 10 months ago by Paul MANDL.
- AuthorPosts
- You must be logged in to reply to this topic.