dcidev_mailer 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dcidev_mailer/rails.rb +21 -20
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4956bc5bb816bedd327ed4807d1e904e57b19a95d684cb3a21fd0ab35bfd9351
4
- data.tar.gz: 5347015c28d96ed779c5c50e47ab24afa6b6a488550c580dcb46d846297e83c7
3
+ metadata.gz: 9bce233b1357d66de38ad38b886e287bf67ffdaa4aea36a926baba5787d0edaa
4
+ data.tar.gz: f4145c04c507c7dec980607cc92d56d8031d98c8745209a3a562b3d4816a1f14
5
5
  SHA512:
6
- metadata.gz: 0aee6dfe65decc88a005b0bc0baf1387a3e0655927d8f24e07f9eb08aaa2b5e3a9d9a2ef430c25ca741477b0d6423a30b1e814db25513af656e786a108e9a220
7
- data.tar.gz: 59282a2ae0a9d575eaf0222c8560f30b12a39745add570d9ade923fc3d4b4476df4de72428e60fb78128b9e2ec0108a3653ed5ecfb867add858ec16bbf5185ee
6
+ metadata.gz: 411ffdeabdab7482555150e620c13b9a05b938017c3e771149d061830ee9e8c2759bffa83efcc46a555d0de57dfec24757d3869ebe8b63c1c4720d5e85742568
7
+ data.tar.gz: 85f8987917de61a5231f345a016309003749e3e41655332662d6e17650e334e77479bdaf1492700d7bcc41fcfb7f1b42b87d75101a8483f534e4058c748f514e
@@ -1,29 +1,30 @@
1
1
  require 'mail'
2
2
 
3
3
  module DcidevMailer
4
- class Rails < ActionMailer::Base
5
- default from: ENV['DEFAULT_EMAIL_SENDER']
4
+ class Rails < ActionMailer::Base
5
+ default from: ENV['DEFAULT_EMAIL_SENDER']
6
6
 
7
- class << self
8
- def email(html_body: "", header_url: "", footer_url: "", file_attachments: nil, to: "", from: nil, subject: "")
9
- wording, images = DcidevMailer.format_image_from_html(html_body)
10
- locals = {wording: wording, header: nil, footer: nil}
11
- locals, images = DcidevMailer.format_header_footer(header_url: header_url, footer_url: footer_url, locals: locals, images: images) if header_url.present? && footer_url.present?
7
+ class << self
8
+ def email(html_body: "", header_url: "", footer_url: "", file_attachments: nil, to: "", from: nil, subject: "")
9
+ wording, images = DcidevMailer.format_image_from_html(html_body)
10
+ locals = { wording: wording, header: nil, footer: nil }
11
+ locals, images = DcidevMailer.format_header_footer(header_url: header_url, footer_url: footer_url, locals: locals, images: images) if header_url.present? && footer_url.present?
12
12
 
13
- if file_attachments.present?
14
- file_attachments.each do |a|
15
- attachments[a[:name].to_s] = a[:content] unless a[:content].nil?
16
- end
17
- end
13
+ if file_attachments.present?
14
+ file_attachments.each do |a|
15
+ attachments[a[:name].to_s] = a[:content] unless a[:content].nil?
16
+ end
17
+ end
18
+
19
+ attachments.inline['header'] = File.read(Utility.download_to_file(header_url)) rescue nil if header_url.present?
20
+ attachments.inline['footer'] = File.read(Utility.download_to_file(footer_url)) rescue nil if footer_url.present?
18
21
 
19
- attachments.inline['header'] = File.read(Utility.download_to_file(header_url)) rescue nil if header_url.present?
20
- attachments.inline['footer'] = File.read(Utility.download_to_file(footer_url)) rescue nil if footer_url.present?
21
-
22
- mail(to: to, subject: subject, format: "text/html", from: from) do |format|
23
- format.html {
24
- render locals: locals
25
- }
26
- end
22
+ mail(to: to, subject: subject, format: "text/html", from: from) do |format|
23
+ format.html {
24
+ render locals: locals
25
+ }
27
26
  end
27
+ end
28
28
  end
29
+ end
29
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dcidev_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Punto Damar P
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-07 00:00:00.000000000 Z
11
+ date: 2022-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mimemagic
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []
70
- rubygems_version: 3.2.3
70
+ rubygems_version: 3.0.6
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: Commonly used email codes