Skip to content

Email pref revamp develop #5363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ workflows:
filters:
branches:
only:
- gsheet-contentful-develop
- free
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
Expand All @@ -303,7 +303,7 @@ workflows:
filters:
branches:
only:
- develop
- email-pref-revamp-develop
- "approve-smoke-test-on-staging":
type: approval
requires:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,69 +10,48 @@ exports[`renders email preferences setting page correctly 1`] = `
E-Mail Preferences
</h1>
<div
className="src-shared-components-Settings-Preferences-Email-___styles__sub-title___2Fh1W"
className="src-shared-components-Settings-Preferences-Email-___styles__unsubscribed-msg___3yh6s"
>
Your preferences
</div>
<div
className="src-shared-components-Settings-Preferences-Email-___styles__preferences-container___38AVF"
>
<ToggleableItem
checked={false}
id="Pipeline"
onToggle={[Function]}
primaryText="Challenge Pipeline"
secondaryText="Subscribe to this newsletter if you want to get updates on the types of challenges coming up in the future. To view these challenges at your leisure you can always visit the <a href=\\"https://www.topcoder.com/community/pipeline\\" style=\\"color:#0d61bf;text-decoration:underline\\">Challenge Pipeline</a> page."
value="Pipeline"
/>
<ToggleableItem
checked={false}
id="Gig Work"
onToggle={[Function]}
primaryText="Gig Work"
secondaryText="This newsletter gets sent out at various times, specifically when we have an opportunity of mass appeal. For more information you can visit the <a href=\\"https://www.topcoder.com/community/taas\\" style=\\"color:#0d61bf;text-decoration:underline\\">Gig Work</a> page."
value="Gig Work"
/>
<ToggleableItem
checked={false}
id="Monthly Newsletter"
onToggle={[Function]}
primaryText="Monthly Newsletter"
secondaryText="This newsletter gets sent out at the end of every month and contains a variety of important information across all of our tracks."
value="Monthly Newsletter"
/>
<ToggleableItem
checked={false}
id="Marathon Match Reminders"
onToggle={[Function]}
primaryText="Marathon Match Reminders"
secondaryText="Receive updates whenever a new marathon match is scheduled."
value="Marathon Match Reminders"
/>
<ToggleableItem
checked={false}
id="Single Round Match Reminders"
onToggle={[Function]}
primaryText="Single Round Match (SRM) Reminders"
secondaryText="Attention Competitive Programmers! If there is any newsletter you are subscribing too, it better be this one. Receive updates when a new SRM event is scheduled."
value="Single Round Match Reminders"
/>
<ToggleableItem
checked={false}
id="TCO Tuesdays"
onToggle={[Function]}
primaryText="TCO Newsletter"
secondaryText="For all the latest updates surrounding the <a href=\\"https://www.topcoder.com/community/member-programs/topcoder-open\\" style=\\"color:#0d61bf;text-decoration:underline\\">Topcoder Open</a> you should definitely be subscribing to this one. Expect an update in your mailbox every Tuesday!"
value="TCO Tuesdays"
/>
<ToggleableItem
checked={false}
id="RDM"
onToggle={[Function]}
primaryText="Rapid Development Match (RDM) Reminders"
secondaryText="Receive notifications of our brand new RDMs! These rated, development matches will be a fun new way to engage with us!"
value="RDM"
/>
<h3>
You are not subscribed to receive Topcoder emails
</h3>
<p>
If this was a mistake or if you would like to resubscribe, please click the button below.
</p>
<form
action="https://topcoder.us13.list-manage.com/subscribe/post?u=65bd5a1857b73643aad556093&id=28bfd3c062"
id="mc-embedded-subscribe-form"
method="post"
name="mc-embedded-subscribe-form"
noValidate={true}
>
<input
id="mce-EMAIL"
name="EMAIL"
readOnly={true}
type="email"
value="[email protected]"
/>
<input
id="gdpr_11101"
name="gdpr[11101]"
type="checkbox"
value="Y"
/>
<input
name="b_65bd5a1857b73643aad556093_28bfd3c062"
tabIndex="-1"
type="text"
value=""
/>
<input
className="submit-button"
id="mc-embedded-subscribe"
name="subscribe"
type="submit"
value="Subscribe"
/>
</form>
</div>
</div>
`;
131 changes: 76 additions & 55 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/server/routes/mailchimp.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ routes.post('/:listId/members', (req, res, next) => new MailchimpService().doReg

routes.get('/:listId/members/:emailHash', (req, res) => new MailchimpService().checkSubscription(req).then(res.send.bind(res)));

routes.put('/:listId/members/:emailHash', (req, res) => new MailchimpService().subscribeInterests(req).then(res.send.bind(res)));
routes.put('/:listId/members/:emailHash', (req, res) => new MailchimpService().updateMember(req).then(res.send.bind(res)));

routes.post('/:listId/members/:emailHash/tags', (req, res) => new MailchimpService().subscribeTags(req).then(res.send.bind(res)));

Expand Down
2 changes: 1 addition & 1 deletion src/server/services/mailchimp.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class MailchimpService {
return res.json();
}

async subscribeInterests(req) {
async updateMember(req) {
const formData = JSON.stringify(req.body);
const res = await fetch(`${this.mailchimpBaseUrl}/lists/${req.params.listId}/members/${req.params.emailHash}`, {
method: 'PUT',
Expand Down
Loading