Skip to content
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

Use loops instead of sendgrid for the newsletter modal #479

Merged
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
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ONE_DAY_MS = 1000 * 60 * 60 * 24
const isSubscribed = localStorage.getItem('subscribed')
// get the last time we showed the modal, or 1 day ago if it's not set yet
const newsletterLastOpenedAt = localStorage.getItem('newsletter-last-opened') || (new Date().getTime()) - ONE_DAY_MS
const newsletterLastOpenDiff = new Date().getTime() - new Date(newsletterLastOpenedAt).getTime()
const newsletterLastOpenDiff = new Date().getTime() - new Date(Number(newsletterLastOpenedAt)).getTime()

const isNewsletterVisible = ref(false)

Expand Down
10 changes: 6 additions & 4 deletions docs/.vitepress/theme/components/NewsletterModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ onBeforeUnmount(() => {
})

const onSubmit = () => {
const LIST_ID = '115e5954-d2cc-4e97-b0dd-e6561d59e660'
const LIST_ID = 'cm19ng3g101z90ll73b380b5s'
isBusy.value = true

const request = axios.put('https://sendgrid-proxy.gorkem.workers.dev/v3/marketing/contacts', {
list_ids: [ LIST_ID ],
contacts: [ { email: email.value } ]
const request = axios.put('https://sendgrid-proxy.gorkem.workers.dev/v1/contacts/update', {
email: email.value,
mailingLists: {
[LIST_ID]: true
}
})

request
Expand Down