Class: Chimpmunk::EmailTemplate
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Chimpmunk::EmailTemplate
- Defined in:
- lib/chimpmunk/email_template.rb
Class Method Summary collapse
-
.refresh_email_templates ⇒ Object
refresh list of templates from mailchimp.
Class Method Details
.refresh_email_templates ⇒ Object
refresh list of templates from mailchimp
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/chimpmunk/email_template.rb', line 14 def self.refresh_email_templates Chimpmunk.mailchimp.templates.list()["user"].each do |template| EmailTemplate.where( mailchimp_id: "#{template["id"]}", name: template["name"], layout: template["layout"], preview_image: template["preview_image"] ).first_or_create end end |