Skip to content

AWS.NotificationsContacts reference

Source: src/AWS/NotificationsContacts/ActivateEmailContact.ts

Runtime binding for notifications-contacts:ActivateEmailContact.

Activate the bound email contact with the activation code the address owner received (see SendActivationCode) — e.g. from a confirmation form in your app. Provide the implementation with Effect.provide(AWS.NotificationsContacts.ActivateEmailContactHttp).

ActivateEmailContact: Activating a Contact

Section titled “ActivateEmailContact: Activating a Contact”
// init — bind the operation to the contact
const activate = yield* AWS.NotificationsContacts.ActivateEmailContact(contact);
// runtime — the user pasted the code from the activation email
yield* activate({ code: Redacted.make(userSuppliedCode) });

Source: src/AWS/NotificationsContacts/EmailContact.ts

An AWS User Notifications Contacts email contact — an email address that can be attached to a notification configuration as a delivery channel.

Contacts are created in the unverified inactive state; activation is a human email-confirmation loop (AWS emails the address a confirmation link), so Alchemy provisions the contact and leaves activation to the address owner. Contacts are immutable (no update API) — changing the name or address replaces the contact; tags update in place.

Basic email contact

import * as NotificationsContacts from "alchemy/AWS/NotificationsContacts";
const contact = yield* NotificationsContacts.EmailContact("OnCall", {
emailAddress: "oncall@example.com",
});
// contact.status === "inactive" until the address owner confirms

Named contact with tags

const contact = yield* NotificationsContacts.EmailContact("OnCall", {
name: "platform-oncall",
emailAddress: "oncall@example.com",
tags: { team: "platform" },
});

Source: src/AWS/NotificationsContacts/GetEmailContact.ts

Runtime binding for notifications-contacts:GetEmailContact.

Read the bound email contact — most usefully its activation status, which flips from inactive to active once the address owner confirms the activation email. Provide the implementation with Effect.provide(AWS.NotificationsContacts.GetEmailContactHttp).

GetEmailContact: Checking Activation Status

Section titled “GetEmailContact: Checking Activation Status”
// init — bind the operation to the contact
const getContact = yield* AWS.NotificationsContacts.GetEmailContact(contact);
// runtime
const result = yield* getContact();
const isActive = result.emailContact.status === "active";

Source: src/AWS/NotificationsContacts/SendActivationCode.ts

Runtime binding for notifications-contacts:SendActivationCode.

Send (or re-send) the activation email to the bound contact’s address. The email contains the activation code the address owner uses to confirm the contact (directly via the emailed link, or through your app via ActivateEmailContact). Provide the implementation with Effect.provide(AWS.NotificationsContacts.SendActivationCodeHttp).

// init — bind the operation to the contact
const sendActivationCode =
yield* AWS.NotificationsContacts.SendActivationCode(contact);
// runtime — e.g. behind a "resend confirmation email" button
yield* sendActivationCode();