2021-07-02 21:03:52 +03:00
<div class="settings-menu-header subview">
2022-02-02 19:09:43 +03:00
<button class="back settings-menu-header-action" data-test-button="close-psm-subview" type="button" {{ on "click" this .close }} > {{ svg-jar "arrow-left" }} <span class="hidden">Back</span></button>
2019-11-08 11:56:56 +03:00
<h4>Email newsletter</h4>
<div style="width:23px;"></div>
</div>
2021-07-02 21:03:52 +03:00
<div class="settings-menu-content settings-menu-email">
2019-11-25 16:20:16 +03:00
{{ # if this .post .email .isSuccess }}
2019-11-08 13:07:47 +03:00
{{!-- Mail has already been sent --}}
2019-11-14 16:30:49 +03:00
<div class="ba b--whitegrey bg-white br3">
<div class="flex pa5 pt4 pb4 items-center bb b--whitegrey">
<div class="w16 flex flex-column items-center">
2021-06-22 21:51:26 +03:00
<span class="db mr4 mt2"> {{ svg-jar "send-email" class = "w6 h6 stroke-midlightgrey" }} </span>
2019-11-14 16:30:49 +03:00
</div>
<div class="flex flex-column justify-center">
<p class="ma0 pa0 midgrey">Post was sent by email to</p>
2020-08-10 13:16:03 +03:00
<p class="ma0 pa0 f5 lh-solid"> {{ gh-pluralize this .post .email .emailCount "member" }} </p>
2019-11-14 16:30:49 +03:00
</div>
</div>
<div class="pa5 pt3 pb3 f7 bb b--whitegrey">
<table class="ma0" style="table-layout: fixed">
<tbody>
<tr>
2019-11-25 19:03:54 +03:00
<td class="pa1 pl0 fw7 f8 w16 v-top lh-copy">Subject:</td>
2020-07-10 20:35:13 +03:00
<td class="pa1 pa0 midgrey v-top lh-copy"> {{ this .post .email .subject }} </td>
2019-11-14 16:30:49 +03:00
</tr>
<tr>
2019-11-25 19:44:50 +03:00
<td class="pa1 pl0 fw7 f8 w16 nowrap v-top lh-copy">Sent:</td>
2020-07-10 20:35:13 +03:00
<td class="pa1 pa0 midgrey v-top lh-copy"> {{ gh-format-post-time this .post .email .createdAtUTC }} </td>
2019-11-14 16:30:49 +03:00
</tr>
</tbody>
</table>
</div>
<div class="pa5 pt3 pb3">
2022-01-25 16:13:18 +03:00
<p class="ma0 pa0">
<GhEmailPreviewLink class="green" @data= {{ this .post }} >View sent email</GhEmailPreviewLink>
</p>
2019-11-14 16:30:49 +03:00
</div>
</div>
2019-11-25 16:20:16 +03:00
{{ else if ( or this .retryEmail .isRunning this .post .email .isFailure ) }}
{{!-- Mail failed to send --}}
2021-02-23 00:33:42 +03:00
<div class="gh-box-error">
2019-11-25 16:20:16 +03:00
<div class="flex pa5 pt4 pb4 items-center bb b--whitegrey">
<div class="w16 flex flex-column items-center">
2019-11-25 19:03:54 +03:00
<span class="db mr4 mt3"> {{ svg-jar "warning" class = "w7 h7 fill-red" }} </span>
2019-11-25 16:20:16 +03:00
</div>
<div class="flex flex-column justify-center">
<p class="ma0 pa0 midgrey">Post failed to send to</p>
2020-08-10 13:16:03 +03:00
<p class="ma0 pa0 f5 lh-solid"> {{ gh-pluralize this .post .email .emailCount "member" }} </p>
2019-11-25 16:20:16 +03:00
</div>
</div>
2019-11-25 19:03:54 +03:00
<div class="pa5 pt3 pb3 f7 bb b--whitegrey">
<p class="mb2 lh-copy">
2021-09-10 13:23:23 +03:00
Email failed to send when publishing this post. Please verify your email settings if the error persists.
2019-11-25 19:03:54 +03:00
</p>
<p class="ma0 pa0">
<table class="ma0" style="table-layout: fixed">
<tbody>
<tr>
<td class="pa1 pl0 fw7 f8 w16 v-top lh-copy">Error:</td>
2020-07-10 20:35:13 +03:00
<td class="pa1 pl0 midgrey v-top lh-copy"> {{ this .post .email .error }} </td>
2019-11-25 19:03:54 +03:00
</tr>
</tbody>
</table>
</p>
</div>
2019-11-25 16:20:16 +03:00
<div class="pa5 pt3 pb3 f7 bb b--whitegrey">
<table class="ma0" style="table-layout: fixed">
<tbody>
<tr>
2019-11-25 19:03:54 +03:00
<td class="pa1 pl0 fw7 f8 w16 v-top lh-copy">Subject:</td>
<td class="pa1 pl0 truncate midgrey v-top lh-copy"> {{ this .post .email .subject }} </td>
2019-11-25 16:20:16 +03:00
</tr>
<tr>
2019-11-25 19:03:54 +03:00
<td class="pa1 pl0 fw7 f8 w16 nowrap v-top lh-copy">Tried:</td>
<td class="pa1 pl0 truncate midgrey v-top lh-copy"> {{ gh-format-post-time this .post .email .createdAtUTC }} </td>
2019-11-25 16:20:16 +03:00
</tr>
</tbody>
</table>
</div>
2019-11-25 19:03:54 +03:00
<div class="pa5 pt3 pb3 flex justify-between items center">
2022-01-25 16:13:18 +03:00
<GhEmailPreviewLink class="blue" @data= {{ this .post }} >View email</GhEmailPreviewLink>
2019-12-13 17:20:29 +03:00
<GhTaskButton @buttonText="Retry send" @runningText="Sending..." @task= {{ this .retryEmail }} @class="gh-btn gh-btn-icon" data-test-button="retry-email" />
2019-11-25 16:20:16 +03:00
</div>
</div>
2019-11-08 13:07:47 +03:00
{{ else }}
{{!-- Mail not sent yet --}}
2019-11-25 16:20:16 +03:00
{{ # if this .mailgunError }}
2020-09-16 16:37:33 +03:00
<p class="gh-box gh-box-alert settings-menu-mailgun-alert">
2022-09-02 18:56:02 +03:00
{{ svg-jar "info" class = "w5 h5 stroke-yellow nl1" }}
2022-05-05 14:36:16 +03:00
You need to configure Mailgun in <LinkTo @route="settings.newsletters" data-test-nav="labs">Settings → Email newsletter</LinkTo> to enable email newsletters.
2019-11-08 13:07:47 +03:00
</p>
{{ / if }}
2019-11-08 11:56:56 +03:00
2019-11-08 13:07:47 +03:00
<form {{ action "discardEnter" on = "submit" }} >
2020-01-16 18:14:03 +03:00
<GhFormGroup @errors= {{ this .post .errors }} @hasValidated= {{ this .post .hasValidated }} @property="emailSubject">
2019-11-08 13:07:47 +03:00
<label for="og-title">Subject</label>
2020-01-16 18:14:03 +03:00
<GhTextInput
@class="post-setting-email-subject"
@id="email-subject"
@name="post-setting-email-subject"
@placeholder= {{ truncate this .emailSubject 4 0 }}
@value= {{ readonly this .emailSubjectScratch }}
@input= {{ action ( mut this .emailSubjectScratch ) value = "target.value" }}
@focus-out= {{ action "setEmailSubject" this .emailSubjectScratch }}
@stopEnterKeyDownPropagation= {{ true }}
@disabled= {{ this .mailgunError }}
data-test-field="email-subject" />
2019-12-13 19:11:49 +03:00
<GhErrorMessage @errors= {{ this .post .errors }} @property="emailSubject" data-test-error="email-subject" />
2020-01-16 18:14:03 +03:00
</GhFormGroup>
2019-11-08 11:56:56 +03:00
2019-11-08 13:07:47 +03:00
<div class="form-group">
<div class="flex">
<label class="nowrap flex-auto">Test email</label>
2022-01-25 16:13:18 +03:00
<GhEmailPreviewLink class="gh-btn gh-btn-link settings-menu-email-button" @data= {{ this .post }} data-test-button="toggle-email-preview">
2021-03-09 14:54:26 +03:00
<span class="green">
2019-11-08 13:07:47 +03:00
Preview in browser
</span>
2022-01-25 16:13:18 +03:00
</GhEmailPreviewLink>
2019-11-08 13:07:47 +03:00
</div>
2019-11-08 11:56:56 +03:00
2019-12-13 17:20:29 +03:00
<div class=" {{ if this .mailgunError "disabled" }} ">
2020-01-16 18:14:03 +03:00
<GhTextInput
@class="post-setting-email-test"
@id="email-test"
@name="post-setting-email-test"
@placeholder="noreply@example.com"
@value= {{ this .testEmailAddress }}
@stopEnterKeyDownPropagation= {{ true }}
@disabled= {{ this .mailgunError }}
data-test-field="email-test" />
2019-11-08 13:07:47 +03:00
2019-11-25 16:20:16 +03:00
{{ # if this .sendTestEmailError }}
<div class="error"><p class="response"> {{ this .sendTestEmailError }} </p></div>
2019-11-08 13:07:47 +03:00
{{ / if }}
2020-01-16 18:14:03 +03:00
<GhTaskButton @buttonText="Send test email"
@task= {{ this .sendTestEmail }}
@successText="Email sent"
@runningText="Sending..."
@class="gh-btn w-100 mt2 gh-btn-icon"
@disabled= {{ this .mailgunError }}
data-test-send-test-mail="true"
/>
2019-11-08 13:07:47 +03:00
</div>
2019-11-08 11:56:56 +03:00
</div>
2019-11-08 13:07:47 +03:00
</form>
{{ / if }}
2022-05-05 14:36:16 +03:00
</div>