Ghost/ghost/admin/app/components/member/newsletter-preference.hbs
Elena Baidakova 696cdea4d9
Add member's email status on member page (#15844)
closes TryGhost/Team#2270
- Show emails status depending on the reason email was blocked
(spam/fail)
2022-11-18 15:55:21 +04:00

56 lines
2.5 KiB
Handlebars

<h4 class="gh-main-section-header small bn">Newsletters</h4>
<div class="gh-main-section-content grey {{if (feature "suppressionList") 'gh-member-newsletter-section'}}">
<div class="gh-member-newsletters">
{{#each this.newsletters as |newsletter|}}
<div class="gh-member-newsletter-row">
<div>
<h4 class="gh-member-newsletter-title">{{newsletter.name}}</h4>
</div>
<div class="for-switch {{if (and (feature "suppressionList") this.suppressionData.suppressed) 'disabled'}}">
<label class="switch" for={{newsletter.forId}}>
<Input
@checked={{newsletter.subscribed}}
@type="checkbox"
id={{newsletter.forId}}
name="subscribed"
data-test-checkbox="member-subscribed"
{{on "click" (fn this.updateNewsletterPreference newsletter)}}
/>
<span class="input-toggle-component"></span>
</label>
</div>
</div>
{{/each}}
</div>
{{#if (and (feature "suppressionList") this.suppressionData.suppressed)}}
<div class="gh-member-newsletter-footer red">
{{#if (eq this.suppressionData.reason 'fail')}}
{{svg-jar "event-email-delivery-failed" class="gh-member-newsletter-footer-icon"}}
{{/if}}
{{#if (eq this.suppressionData.reason 'spam')}}
{{svg-jar "event-email-delivery-spam" class="gh-member-newsletter-footer-icon"}}
{{/if}}
<div class="gh-member-newsletter-footer-text">
{{#if (eq this.suppressionData.reason 'fail')}}
Member email was suppressed due to it bouncing on {{this.suppressionData.date}}
{{/if}}
{{#if (eq this.suppressionData.reason 'spam')}}
Member email was suppressed due to a spam complaint on {{this.suppressionData.date}}
{{/if}}
<a class="midgrey" href="javascript:void(0)" target="_blank" rel="noopener noreferrer">Learn more</a>
</div>
</div>
{{/if}}
{{#if (and (feature "suppressionList") (not this.suppressionData.suppressed))}}
<div class="gh-member-newsletter-footer midgrey">
If disabled, member will <i>not</i> receive newsletter emails
</div>
{{/if}}
</div>