studio-engine 0.43.0 → 0.44.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60d9ce89189f6f027c2158888a403269310397f20cb86cddc88519e9ec4644bb
4
- data.tar.gz: cb5f1ee58d3825e6b3ee705f07f8ede2cd2ebed14e2d86f03ddf22c1debb4b20
3
+ metadata.gz: 7a0bd2a31039b41d7b5f7fe70a6865308d2fec97e6bfeae301f254b173352dc2
4
+ data.tar.gz: 14e41f376424c34cd73c92eae84310eb18b24dc2165ac727948d7d9cbed9379a
5
5
  SHA512:
6
- metadata.gz: 2d82567b9773871905899b6519699d95d5c05a73c5239914c3535d9a16198f6282c7d30309f07bb7961760d51a114ba031c4f20b83321ae1eb71f2ef7b7dc065
7
- data.tar.gz: ae096e420cc8e25d8cb34013f6fc5eee1b41b5c102561b626bf67330b64e0115067ba0c237d32ab9b2c96f963181ae6c419f2fbf01f2f909504337980942cd9f
6
+ metadata.gz: '097bd2947f0e2c0a02a21b76cb01ed7816fd1c7ff1cc077576a15b8e125ef3e13ce81ac7a0c8500de367c37f663cd8d1cdfb4599511f760efe6a9e2994fdbaeb'
7
+ data.tar.gz: 72b9f3066838d5494036601d29a0de70a6c33d69e84ccfcd788e459e493f16d5a9b1c130a7b3c36c8604081823ddb8fa9274e5b61eef97da0246ace104e70392
@@ -19,7 +19,20 @@ module Studio
19
19
  # unsubscribe_url is OPTIONAL and the line renders only when it is given.
20
20
  # A newsletter needs a way out, but a hard-coded dead link is worse than an
21
21
  # honest omission — a host wires its real one and the line appears.
22
- def subscribed(email, name: nil, unsubscribe_url: nil)
22
+ #
23
+ # `from` is OPTIONAL on the same terms, and it exists for a reason worth
24
+ # stating: THIS EMAIL IS MARKETING, and the rest of what this engine sends
25
+ # is transactional. A host that keeps a separate marketing address does so
26
+ # to protect the reputation of the address its SIGN-IN LINKS go out on —
27
+ # complaints and unsubscribes against a newsletter must not follow the
28
+ # address someone needs to get back into their account. Without this
29
+ # parameter a host with that separation could not migrate onto this mailer
30
+ # without giving it up, which is a deliverability regression disguised as an
31
+ # adoption.
32
+ #
33
+ # Omitted, nothing changes: ActionMailer falls back to the default_from the
34
+ # host already configured.
35
+ def subscribed(email, name: nil, unsubscribe_url: nil, from: nil)
23
36
  @app_name = Studio.app_name
24
37
  @email = email
25
38
  @name = name.presence
@@ -41,7 +54,12 @@ module Studio
41
54
 
42
55
  subject = Studio::EmailCatalog.subject_for(:newsletter_subscribed, name: @name) ||
43
56
  "You're subscribed to #{@app_name}"
44
- mail(to: email, subject: subject)
57
+ # Built conditionally rather than passing `from: nil`: ActionMailer treats
58
+ # an explicit nil as a SET header and drops the host's default_from,
59
+ # sending with no From at all.
60
+ headers = { to: email, subject: subject }
61
+ headers[:from] = from if from.present?
62
+ mail(**headers)
45
63
  end
46
64
  end
47
65
  end
@@ -1,3 +1,3 @@
1
1
  module Studio
2
- VERSION = "0.43.0"
2
+ VERSION = "0.44.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: studio-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex McRitchie