Sha256: bce3c1495615d66adca02beae9ddd86f3a73f60a0dfeef9cf1ffad81a2a64d1e
Contents?: true
Size: 1.21 KB
Versions: 57
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true require "mustache" module Decidim class WelcomeNotificationEvent < Decidim::Events::BaseEvent include Decidim::Events::EmailEvent include Decidim::Events::NotificationEvent include TranslationsHelper delegate :organization, to: :user, prefix: false delegate :url_helpers, to: "Decidim::Core::Engine.routes" def subject interpolate(organization.welcome_notification_subject.symbolize_keys[I18n.locale]) end def body interpolate(organization.welcome_notification_body.symbolize_keys[I18n.locale]) end def email_subject subject end def email_greeting; end def email_intro body end def email_outro; end def notification_title ("<p><strong>#{subject}</strong></p>" + body).html_safe end def resource_path nil end def resource_title nil end private def interpolate(template) Mustache.render( template.to_s, organization: organization.name, name: user.name, help_url: url_helpers.pages_url(host: organization.host), badges_url: url_helpers.gamification_badges_url(host: organization.host) ).html_safe end end end
Version data entries
57 entries across 57 versions & 1 rubygems