bookingactivities / booking-activities

Wordpress plugin booking system
GNU General Public License v3.0
29 stars 10 forks source link

Tag for "type of event" for use in notifications #129

Closed pikurasa closed 1 year ago

pikurasa commented 2 years ago

If, for example, someone sells 1) "classes", 2) "concerts", and 3) "activities"

it is useful to be able to put in the notifications subject line:

Your {type_of_event} starts tomorrow

where {type_of_event} could be any of 1, 2, or 3.

I think this may be possible now, but the steps to achieve this are not obvious to me. Please advise.

If it is not possible, let's brainstorm a simple way to make it possible. Thanks!

yoancutillas commented 2 years ago

You can add a custom notification tag with custom code as described here: https://github.com/bookingactivities/booking-activities/issues/49#issuecomment-577731290

Maybe you can use the values defined in Booking Activities > Calendar editor > the activity settings > Text tab > "Unit name (singular)" and "Unit name (plural)". Here is an example for reference: $tags[ '{type_of_event_singular}' ] = $booking_type === 'single' ? apply_filters( 'bookacti_translate_text', (string) bookacti_get_metadata( 'activity', $booking->activity_id, 'unit_name_singular', true ), $locale ) : 'group of events';