Class: WcoEmail::EmailTemplate

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Paranoia, Mongoid::Timestamps
Defined in:
app/models/wco_email/email_template.rb

Constant Summary collapse

LAYOUTS =
%w| plain
m20221201react m20221222merryxmas
m202309_feedback
m202309_ror4
marketing_node_1
marketing_react_1
marketing_react_2
marketing_react_3
marketing_ror_1
marketing_ror_2
marketing_wordpres_1
marketing_wordpress_2
piousbox_roundborders
plain
test_tracking_footer
wasyaco_roundborders |
DEFAULT_FROM_EMAIL =
'Victor Pudeyev <[email protected]>'
FROM_EMAILS =
[
  'Annesque Studio <[email protected]>',
  'Annesque Studio <[email protected]>',

  'BJJCollective <[email protected]>',
  'BJJCollective <[email protected]>',

  'DemmiTV <[email protected]>',
  'DemmiTV <[email protected]>',

  'Victor Pudeyev <[email protected]>',

  'Infinite Shelter <[email protected]>',
  'Infinite Shelter <[email protected]>',

  'Oquaney Splicing <[email protected]>',
  'Oquaney Splicing <[email protected]>',

  'Victor Pudeyev <[email protected]>',
  'Victor Pudeyev <[email protected]>',
  'Victor Pudeyev <[email protected]>',
  'Victor Pudeyev <[email protected]>',

  'Sender SBS <[email protected]>',
  'Sender SBS <[email protected]>',

  'WasyaCo Consulting <[email protected]>',
  'Alex WCo <[email protected]>',
  'Bailey WCo <[email protected]>',
  'Cameron WCo <[email protected]>',
  'WasyaCo Consulting <[email protected]>',
  'Jess WCo <[email protected]>',
  'WasyaCo Consulting <[email protected]>',
  'Victor Pudeyev <[email protected]>',

  'WasyaCo Consulting <[email protected]>',
  'Alex WCo <[email protected]>',
  'Bailey WCo <[email protected]>',
  'Cameron WCo <[email protected]>',
  'WasyaCo Consulting <[email protected]>',
  'WasyaCo Consulting <[email protected]>',
  'Victor Pudeyev <[email protected]>',

  'Wasya Co Mailer <[email protected]>',
  'Wasya Co Mailer <[email protected]>',
]
FROM_EMAILS_2 =
[
  [ nil, nil ],

  [ 'Victor Pudeyev <[email protected]>',    '[email protected]' ],
  [ 'Victor Pudeyev <[email protected]>',   '[email protected]' ],
  [ 'Victor Pudeyev <[email protected]>', '[email protected]' ],

  [ 'WasyaCo Consulting <[email protected]>', '[email protected]' ],
  [ 'Victor Pudeyev <[email protected]>',       '[email protected]' ],

]
SIGNATURE =
"<div>\n<div><br></div>\n<div>Regards,</div>\n<div>-=----- &gt;8 --</div>\n<div>Victor Pudeyev<br>Director of Engineering<br><a href=\"mailto:[email protected]\" target=\"_blank\">[email protected]</a> | <a href=\"https://tidycal.com/wasya-co/30min\" target=\"_blank\">Book a chat</a><br></div>\n</div><hr /><br /><br /><br />\n"
SLUG_BLANK =
'blank'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.blankObject



134
# File 'app/models/wco_email/email_template.rb', line 134

def self.blank; self.blank_template; end

.blank_templateObject



131
132
133
# File 'app/models/wco_email/email_template.rb', line 131

def self.blank_template
  out = Tmpl.find_or_create_by({ slug: SLUG_BLANK })
end

.from_emails_listObject



105
106
107
108
# File 'app/models/wco_email/email_template.rb', line 105

def self.from_emails_list
  # [ [nil, nil] ] + FROM_EMAILS.map { |i| [i, i] }
  FROM_EMAILS_2
end

.listObject



136
137
138
# File 'app/models/wco_email/email_template.rb', line 136

def self.list
  [[nil,nil]] + all.map { |p| [ p.slug, p.id ] }
end

Instance Method Details

#config_exeObject

unused! vp 2023-09-24



40
# File 'app/models/wco_email/email_template.rb', line 40

field :config_exe,                      default: ""

#get_bindingObject

2023-03-04 vp This works!



120
121
122
123
# File 'app/models/wco_email/email_template.rb', line 120

def get_binding
  # @lead = Lead.where( email: '[email protected]' ).first
  binding()
end

#to_sObject



13
14
15
# File 'app/models/wco_email/email_template.rb', line 13

def to_s
  "Tmpl:#{slug}"
end