0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Fixed default sender address when email is managed (#19186)

fixes GRO-74

- uses the calculated setting "default_email_address" as first fallback, if there is no sender email for the newsletter
This commit is contained in:
Sag 2023-11-29 16:24:16 -03:00 committed by GitHub
parent 22c6527c49
commit 3b7dc7555d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -13,7 +13,7 @@
@triggerComponent={{component "gh-power-select/trigger"}} @triggerComponent={{component "gh-power-select/trigger"}}
@triggerClass="gh-preview-newsletter-trigger" @triggerClass="gh-preview-newsletter-trigger"
@dropdownClass="gh-publish-newsletter-dropdown gh-preview-newsletter-dropdown" @dropdownClass="gh-publish-newsletter-dropdown gh-preview-newsletter-dropdown"
@extra={{concat "<" (full-email-address (or this.newsletter.senderEmail "noreply")) ">"}} @extra={{concat "<" (full-email-address (or this.newsletter.senderEmail this.settings.defaultEmailAddress "noreply")) ">"}}
@selectedItemComponent={{component "editor/modals/preview/selected-newsletter-label"}} @selectedItemComponent={{component "editor/modals/preview/selected-newsletter-label"}}
data-test-email-preview-newsletter-select data-test-email-preview-newsletter-select
as |option| as |option|
@ -23,7 +23,7 @@
{{else}} {{else}}
<p class="gh-preview-newsletter-name">{{this.newsletter.name}} <span <p class="gh-preview-newsletter-name">{{this.newsletter.name}} <span
class="gh-preview-email-address">&lt;{{full-email-address class="gh-preview-email-address">&lt;{{full-email-address
(or this.newsletter.senderEmail "noreply")}}&gt;</span></p> (or this.newsletter.senderEmail this.settings.defaultEmailAddress "noeply")}}&gt;</span></p>
{{/if}} {{/if}}
</div> </div>
<div class="gh-email-preview-newsletter-select" data-test-email-preview-segment-select-section> <div class="gh-email-preview-newsletter-select" data-test-email-preview-segment-select-section>

View file

@ -20,7 +20,7 @@
<div class="gh-pe-mobile-screen"> <div class="gh-pe-mobile-screen">
<div class="gh-pe-emailclient-sender"> <div class="gh-pe-emailclient-sender">
<p> <p>
<span class="strong">{{or this.newsletter.senderName this.settings.title}}</span> &lt;{{full-email-address (or this.newsletter.senderEmail "noreply")}}&gt; <span class="strong">{{or this.newsletter.senderName this.settings.title}}</span> &lt;{{full-email-address (or this.newsletter.senderEmail this.settings.defaultEmailAddress "noreply")}}&gt;
</p> </p>
<p><span class="dark">To:</span> Jamie Larson &lt;jamie@example.com&gt;</p> <p><span class="dark">To:</span> Jamie Larson &lt;jamie@example.com&gt;</p>
</div> </div>
@ -35,7 +35,7 @@
<div class="gh-pe-emailclient-mockup"> <div class="gh-pe-emailclient-mockup">
<div class="gh-pe-emailclient-sender"> <div class="gh-pe-emailclient-sender">
<p> <p>
<span class="strong">{{or this.newsletter.senderName this.settings.title}}</span> &lt;{{full-email-address (or this.newsletter.senderEmail "noreply")}}&gt; <span class="strong">{{or this.newsletter.senderName this.settings.title}}</span> &lt;{{full-email-address (or this.newsletter.senderEmail this.settings.defaultEmailAddress "noreply")}}&gt;
</p> </p>
<p><span class="dark">To:</span> Jamie Larson &lt;jamie@example.com&gt;</p> <p><span class="dark">To:</span> Jamie Larson &lt;jamie@example.com&gt;</p>
</div> </div>

View file

@ -110,6 +110,12 @@ export default Model.extend(ValidationEngine, {
*/ */
recommendationsEnabled: attr('boolean'), recommendationsEnabled: attr('boolean'),
/**
* Newsletter emails
*/
defaultEmailAddress: attr('string'),
supportEmailAddress: attr('string'),
// HACK - not a real model attribute but a workaround for Ember Data not // HACK - not a real model attribute but a workaround for Ember Data not
// exposing meta from save responses // exposing meta from save responses
_meta: attr() _meta: attr()