Module: Spree::MailHelperDecorator
- Defined in:
- app/helpers/spree/mail_helper_decorator.rb
Instance Method Summary collapse
- #format_date(day) ⇒ Object
- #google_map(lat, lon) ⇒ Object
- #notice_info(current_store, product_type) ⇒ Object
- #user_full_name(order) ⇒ Object
- #vendor(vendor_id) ⇒ Object
Instance Method Details
#format_date(day) ⇒ Object
11 12 13 |
# File 'app/helpers/spree/mail_helper_decorator.rb', line 11 def format_date(day) day&.strftime('%A %d, %B, %Y') end |
#google_map(lat, lon) ⇒ Object
15 16 17 |
# File 'app/helpers/spree/mail_helper_decorator.rb', line 15 def google_map(lat, lon) "https://www.google.com/maps/@#{lat},#{lon},15z?entry=ttu" end |
#notice_info(current_store, product_type) ⇒ Object
19 20 21 22 23 |
# File 'app/helpers/spree/mail_helper_decorator.rb', line 19 def notice_info(current_store, product_type) notice_page = current_store.cms_pages.find_by(slug: 'hotel-notice') notice_page = current_store.cms_pages.find_by(slug: 'event-notice') if product_type == 'ecommerce' notice_page.content end |
#user_full_name(order) ⇒ Object
3 4 5 |
# File 'app/helpers/spree/mail_helper_decorator.rb', line 3 def user_full_name(order) order.name end |
#vendor(vendor_id) ⇒ Object
7 8 9 |
# File 'app/helpers/spree/mail_helper_decorator.rb', line 7 def vendor(vendor_id) Spree::Vendor.find(vendor_id) end |