Sha256: 77eb5adf600437a28c70e00ee029c0e47482a8a6d6d4550c34c7462b0feae711

Contents?: true

Size: 1.54 KB

Versions: 18

Compression:

Stored size: 1.54 KB

Contents

class <%= model_name %>Mailer < Mailer

  helper :<%= model_name_pluralize_underscored %>

  def <%= model_name_underscored %>_added(recipient, <%= model_name_underscored %>)
    <%- if project? -%>
    redmine_headers 'Project' => <%= model_name_underscored %>.project.identifier

    <%- end -%>
    <%- if author? -%>
    @author = <%= model_name_underscored %>.author
    <%- end -%>
    @<%= model_name_underscored %> = <%= model_name_underscored %>
    @<%= model_name_underscored %>_url = url_for(controller: '<%= model_name_pluralize_underscored %>', action: 'show', id: <%= model_name_underscored %>)

    message_id <%= model_name_underscored %>
    references <%= model_name_underscored %>

    mail to: recipient,
      subject: "#{l(:label_<%= model_name_underscored %>)}: #{<%= model_name_underscored %>.to_s}"
  end

  def <%= model_name_underscored %>_updated(recipient, <%= model_name_underscored %>)
    <%- if project? -%>
    redmine_headers 'Project' => <%= model_name_underscored %>.project.identifier

    <%- end -%>
    <%- if author? -%>
    @author = <%= model_name_underscored %>.author
    <%- end -%>
    @<%= model_name_underscored %> = <%= model_name_underscored %>
    @<%= model_name_underscored %>_url = url_for(controller: '<%= model_name_pluralize_underscored %>', action: 'show', id: <%= model_name_underscored %>)

    message_id <%= model_name_underscored %>
    references <%= model_name_underscored %>

    mail to: recipient,
      subject: "#{l(:label_<%= model_name_underscored %>)}: #{<%= model_name_underscored %>.to_s}"
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
redmine_extensions-0.6.3 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.6.2 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.6.1 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.6.0 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.4.5 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.5.1 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.4.4 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.4.3 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.4.1 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.4.0 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.4.0.beta lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.3.11 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.3.10 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.3.9 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.3.8 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.3.7 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.3.6 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb
redmine_extensions-0.3.4 lib/generators/redmine_extensions/entity/templates/mailer.rb.erb