Module: Hanami::Mailer::Dsl
- Defined in:
- gems/gems/hanami-mailer-1.3.1/lib/hanami/mailer/dsl.rb,
gems/gems/hanami-mailer-1.3.3/lib/hanami/mailer/dsl.rb
Overview
Class level DSL
Instance Method Summary collapse
-
#bcc(value = nil) ⇒ Object
Sets the bcc (blind carbon copy) for mail messages.
-
#cc(value = nil) ⇒ Object
Sets the cc (carbon copy) for mail messages.
-
#from(value = nil) ⇒ Object
Sets the sender for mail messages.
-
#reply_to(value = nil) ⇒ Object
Sets the reply_to for mail messages.
-
#return_path(value = nil) ⇒ Object
Sets the MAIL FROM address for mail messages.
-
#subject(value = nil) ⇒ Object
Sets the subject for mail messages.
-
#template(value = nil) ⇒ Object
Set the template name IF it differs from the convention.
-
#to(value = nil) ⇒ Object
Sets the recipient for mail messages.
Instance Method Details
#bcc(value) ⇒ NilClass #bcc ⇒ String, ...
Sets the bcc (blind carbon copy) for mail messages
It accepts a hardcoded value as a string or array of strings. For dynamic values, you can specify a symbol that represents an instance method.
This value is optional.
When a value is given, it specifies the bcc for the email. When a value is not given, it returns the bcc of the email.
This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding class variable. When called without, it will return the already set value, or the default.
Source: | on GitHub
def bcc(value = nil) if value.nil? @bcc else @bcc = value end end |
#cc(value) ⇒ NilClass #cc ⇒ String, ...
Sets the cc (carbon copy) for mail messages
It accepts a hardcoded value as a string or array of strings. For dynamic values, you can specify a symbol that represents an instance method.
This value is optional.
When a value is given, it specifies the cc for the email. When a value is not given, it returns the cc of the email.
This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding class variable. When called without, it will return the already set value, or the default.
Source: | on GitHub
def cc(value = nil) if value.nil? @cc else @cc = value end end |
#from(value) ⇒ NilClass #from ⇒ String, Symbol
Sets the sender for mail messages
It accepts a hardcoded value as a string, or a symbol that represents an instance method for more complex logic.
This value MUST be set, otherwise an exception is raised at the delivery time.
When a value is given, specify the sender of the email Otherwise, it returns the sender of the email
This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding class variable. When called without, it will return the already set value, or the default.
Source: | on GitHub
def from(value = nil) if value.nil? @from else @from = value end end |
#reply_to(value) ⇒ NilClass #reply_to ⇒ String, ...
Sets the reply_to for mail messages
It accepts a hardcoded value as a string or array of strings. For dynamic values, you can specify a symbol that represents an instance method.
This value is optional.
When a value is given, it specifies the reply_to for the email. When a value is not given, it returns the reply_to of the email.
This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding class variable. When called without, it will return the already set value, or the default.
Source: | on GitHub
def reply_to(value = nil) if value.nil? @reply_to else @reply_to = value end end |
#return_path(value) ⇒ NilClass #return_path ⇒ String, Symbol
Sets the MAIL FROM address for mail messages. This lets you specify a “bounce address” different from the sender address specified with from
.
It accepts a hardcoded value as a string, or a symbol that represents an instance method for more complex logic.
This value is optional.
When a value is given, specify the MAIL FROM address of the email Otherwise, it returns the MAIL FROM address of the email
This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding class variable. When called without, it will return the already set value, or the default.
Source: | on GitHub
def return_path(value = nil) if value.nil? @return_path else @return_path = value end end |
#subject(value) ⇒ NilClass #subject ⇒ String, Symbol
Sets the subject for mail messages
It accepts a hardcoded value as a string, or a symbol that represents an instance method for more complex logic.
This value MUST be set, otherwise an exception is raised at the delivery time.
This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding class variable. When called without, it will return the already set value, or the default.
Source: | on GitHub
def subject(value = nil) if value.nil? @subject else @subject = value end end |
#template(value) ⇒ NilClass #template ⇒ String
Set the template name IF it differs from the convention.
For a given mailer named Signup::Welcome
it will look for signup/welcome..
templates under the root directory.
If for some reason, we need to specify a different template name, we can use this method.
This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding class variable. When called without, it will return the already set value, or the default.
#to(value) ⇒ NilClass #to ⇒ String, ...
Sets the recipient for mail messages
It accepts a hardcoded value as a string or array of strings. For dynamic values, you can specify a symbol that represents an instance method.
This value MUST be set, otherwise an exception is raised at the delivery time.
When a value is given, specify the recipient of the email Otherwise, it returns the recipient of the email
This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding class variable. When called without, it will return the already set value, or the default.
Source: | on GitHub
def to(value = nil) if value.nil? @to else @to = value end end |