Class: Crm::Mailing
- Inherits:
-
Core::BasicResource
- Object
- Core::BasicResource
- Crm::Mailing
- Extended by:
- Core::Mixins::Findable::ClassMethods, Core::Mixins::Modifiable::ClassMethods, Core::Mixins::Searchable::ClassMethods
- Includes:
- Core::Mixins::ChangeLoggable, Core::Mixins::Findable, Core::Mixins::Inspectable, Core::Mixins::Modifiable, Core::Mixins::Searchable
- Defined in:
- lib/crm/mailing.rb
Overview
The purpose of an Infopark WebCRM mailing is to send an e-mail, e.g. a newsletter, to several recipients. The e-mails will be sent to the members of the contact collection associated with the mailing (mailing.collection_id).
Infopark WebCRM uses the / Liquid template engine for evaluating mailing content.
Instance Method Summary collapse
-
#release ⇒ self
Releases this mailing.
-
#render_preview(render_for_contact_or_id) ⇒ Hash{String => String}
Renders a preview of the e-mail for the given contact.
-
#send_me_a_proof_email(render_for_contact_or_id) ⇒ Hash{String => String}
Sends a proof e-mail (personalized for a contact) to the current user (the API user).
-
#send_single_email(recipient_contact_or_id) ⇒ Hash{String => String}
Sends this mailing to a single contact.
Methods included from Core::Mixins::Findable::ClassMethods
Methods included from Core::Mixins::Modifiable::ClassMethods
Methods included from Core::Mixins::Searchable::ClassMethods
all, first, query, search_configurator, where, where_not
Methods included from Core::Mixins::Inspectable
Methods included from Core::Mixins::ChangeLoggable
Methods included from Core::Mixins::Modifiable
#delete, #deleted?, #undelete, #update
Methods inherited from Core::BasicResource
base_type, #eql?, #id, path, #path, #reload, resource_name, #type
Methods included from Core::Mixins::AttributeProvider
#[], #attributes, #initialize, #method_missing, #methods, #raw, #respond_to_missing?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Crm::Core::Mixins::AttributeProvider
Instance Method Details
#release ⇒ self
Releases this mailing.
Sends the mailing to all recipients, marks the mailing as released (released_at, released_by), and also sets planned_release_at to now.
97 98 99 |
# File 'lib/crm/mailing.rb', line 97 def release load_attributes(Core::RestApi.instance.post("#{path}/release", {})) end |
#render_preview(render_for_contact_or_id) ⇒ Hash{String => String}
Renders a preview of the e-mail for the given contact.
44 45 46 47 48 |
# File 'lib/crm/mailing.rb', line 44 def render_preview(render_for_contact_or_id) Core::RestApi.instance.post("#{path}/render_preview", { 'render_for_contact_id' => extract_id(render_for_contact_or_id) }) end |
#send_me_a_proof_email(render_for_contact_or_id) ⇒ Hash{String => String}
Sends a proof e-mail (personalized for a contact) to the current user (the API user).
60 61 62 63 64 |
# File 'lib/crm/mailing.rb', line 60 def send_me_a_proof_email(render_for_contact_or_id) Core::RestApi.instance.post("#{path}/send_me_a_proof_email", { 'render_for_contact_id' => extract_id(render_for_contact_or_id) }) end |
#send_single_email(recipient_contact_or_id) ⇒ Hash{String => String}
Sends this mailing to a single contact.
Use case: If someone registers for a newsletter, you can send them the most recent issue that has already been released.
85 86 87 88 89 |
# File 'lib/crm/mailing.rb', line 85 def send_single_email(recipient_contact_or_id) Core::RestApi.instance.post("#{path}/send_single_email", { 'recipient_contact_id' => extract_id(recipient_contact_or_id) }) end |