Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/appwrite/mod.ts>Messaging

[READ-ONLY] Official Appwrite Deno SDK 🦕
Go to Latest
class Messaging
extends Service
Re-export
import { Messaging } from "https://deno.land/x/appwrite@10.0.0/mod.ts";

Constructors

new
Messaging(client: Client)

Methods

createApnsProvider(
providerId: string,
name: string,
authKey?: string,
authKeyId?: string,
teamId?: string,
bundleId?: string,
sandbox?: boolean,
enabled?: boolean,
): Promise<Models.Provider>

Create APNS provider

Create a new Apple Push Notification service provider.

createEmail(
messageId: string,
subject: string,
content: string,
topics?: string[],
users?: string[],
targets?: string[],
cc?: string[],
bcc?: string[],
attachments?: string[],
draft?: boolean,
html?: boolean,
scheduledAt?: string,
): Promise<Models.Message>

Create email

Create a new email message.

createFcmProvider(
providerId: string,
name: string,
serviceAccountJSON?: object,
enabled?: boolean,
): Promise<Models.Provider>

Create FCM provider

Create a new Firebase Cloud Messaging provider.

createMailgunProvider(
providerId: string,
name: string,
apiKey?: string,
domain?: string,
isEuRegion?: boolean,
fromName?: string,
fromEmail?: string,
replyToName?: string,
replyToEmail?: string,
enabled?: boolean,
): Promise<Models.Provider>

Create Mailgun provider

Create a new Mailgun provider.

createMsg91Provider(
providerId: string,
name: string,
from?: string,
senderId?: string,
authKey?: string,
enabled?: boolean,
): Promise<Models.Provider>

Create Msg91 provider

Create a new MSG91 provider.

createPush(
messageId: string,
title: string,
body: string,
topics?: string[],
users?: string[],
targets?: string[],
data?: object,
action?: string,
image?: string,
icon?: string,
sound?: string,
color?: string,
tag?: string,
badge?: string,
draft?: boolean,
scheduledAt?: string,
): Promise<Models.Message>

Create push notification

Create a new push notification.

createSendgridProvider(
providerId: string,
name: string,
apiKey?: string,
fromName?: string,
fromEmail?: string,
replyToName?: string,
replyToEmail?: string,
enabled?: boolean,
): Promise<Models.Provider>

Create Sendgrid provider

Create a new Sendgrid provider.

createSms(
messageId: string,
content: string,
topics?: string[],
users?: string[],
targets?: string[],
draft?: boolean,
scheduledAt?: string,
): Promise<Models.Message>

Create SMS

Create a new SMS message.

createSmtpProvider(
providerId: string,
name: string,
host: string,
port?: number,
username?: string,
password?: string,
encryption?: SmtpEncryption,
autoTLS?: boolean,
mailer?: string,
fromName?: string,
fromEmail?: string,
replyToName?: string,
replyToEmail?: string,
enabled?: boolean,
): Promise<Models.Provider>

Create SMTP provider

Create a new SMTP provider.

createSubscriber(
topicId: string,
subscriberId: string,
targetId: string,
): Promise<Models.Subscriber>

Create subscriber

Create a new subscriber.

createTelesignProvider(
providerId: string,
name: string,
from?: string,
customerId?: string,
apiKey?: string,
enabled?: boolean,
): Promise<Models.Provider>

Create Telesign provider

Create a new Telesign provider.

createTextmagicProvider(
providerId: string,
name: string,
from?: string,
username?: string,
apiKey?: string,
enabled?: boolean,
): Promise<Models.Provider>

Create Textmagic provider

Create a new Textmagic provider.

createTopic(
topicId: string,
name: string,
subscribe?: string[],
): Promise<Models.Topic>

Create topic

Create a new topic.

createTwilioProvider(
providerId: string,
name: string,
from?: string,
accountSid?: string,
authToken?: string,
enabled?: boolean,
): Promise<Models.Provider>

Create Twilio provider

Create a new Twilio provider.

createVonageProvider(
providerId: string,
name: string,
from?: string,
apiKey?: string,
apiSecret?: string,
enabled?: boolean,
): Promise<Models.Provider>

Create Vonage provider

Create a new Vonage provider.

delete(messageId: string): Promise<Response>

Delete message

Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.

deleteProvider(providerId: string): Promise<Response>

Delete provider

Delete a provider by its unique ID.

deleteSubscriber(topicId: string, subscriberId: string): Promise<Response>

Delete subscriber

Delete a subscriber by its unique ID.

deleteTopic(topicId: string): Promise<Response>

Delete topic

Delete a topic by its unique ID.

getMessage(messageId: string): Promise<Models.Message>

Get message

Get a message by its unique ID.

getProvider(providerId: string): Promise<Models.Provider>

Get provider

Get a provider by its unique ID.

getSubscriber(topicId: string, subscriberId: string): Promise<Models.Subscriber>

Get subscriber

Get a subscriber by its unique ID.

getTopic(topicId: string): Promise<Models.Topic>

Get topic

Get a topic by its unique ID.

listMessageLogs(messageId: string, queries?: string[]): Promise<Models.LogList>

List message logs

Get the message activity logs listed by its unique ID.

listMessages(queries?: string[], search?: string): Promise<Models.MessageList>

List messages

Get a list of all messages from the current Appwrite project.

listProviderLogs(providerId: string, queries?: string[]): Promise<Models.LogList>

List provider logs

Get the provider activity logs listed by its unique ID.

listProviders(queries?: string[], search?: string): Promise<Models.ProviderList>

List providers

Get a list of all providers from the current Appwrite project.

listSubscriberLogs(subscriberId: string, queries?: string[]): Promise<Models.LogList>

List subscriber logs

Get the subscriber activity logs listed by its unique ID.

listSubscribers(
topicId: string,
queries?: string[],
search?: string,
): Promise<Models.SubscriberList>

List subscribers

Get a list of all subscribers from the current Appwrite project.

listTargets(messageId: string, queries?: string[]): Promise<Models.TargetList>

List message targets

Get a list of the targets associated with a message.

listTopicLogs(topicId: string, queries?: string[]): Promise<Models.LogList>

List topic logs

Get the topic activity logs listed by its unique ID.

listTopics(queries?: string[], search?: string): Promise<Models.TopicList>

List topics

Get a list of all topics from the current Appwrite project.

updateApnsProvider(
providerId: string,
name?: string,
enabled?: boolean,
authKey?: string,
authKeyId?: string,
teamId?: string,
bundleId?: string,
sandbox?: boolean,
): Promise<Models.Provider>

Update APNS provider

Update a Apple Push Notification service provider by its unique ID.

updateEmail(
messageId: string,
topics?: string[],
users?: string[],
targets?: string[],
subject?: string,
content?: string,
draft?: boolean,
html?: boolean,
cc?: string[],
bcc?: string[],
scheduledAt?: string,
): Promise<Models.Message>

Update email

Update an email message by its unique ID.

updateFcmProvider(
providerId: string,
name?: string,
enabled?: boolean,
serviceAccountJSON?: object,
): Promise<Models.Provider>

Update FCM provider

Update a Firebase Cloud Messaging provider by its unique ID.

updateMailgunProvider(
providerId: string,
name?: string,
apiKey?: string,
domain?: string,
isEuRegion?: boolean,
enabled?: boolean,
fromName?: string,
fromEmail?: string,
replyToName?: string,
replyToEmail?: string,
): Promise<Models.Provider>

Update Mailgun provider

Update a Mailgun provider by its unique ID.

updateMsg91Provider(
providerId: string,
name?: string,
enabled?: boolean,
senderId?: string,
authKey?: string,
from?: string,
): Promise<Models.Provider>

Update Msg91 provider

Update a MSG91 provider by its unique ID.

updatePush(
messageId: string,
topics?: string[],
users?: string[],
targets?: string[],
title?: string,
body?: string,
data?: object,
action?: string,
image?: string,
icon?: string,
sound?: string,
color?: string,
tag?: string,
badge?: number,
draft?: boolean,
scheduledAt?: string,
): Promise<Models.Message>

Update push notification

Update a push notification by its unique ID.

updateSendgridProvider(
providerId: string,
name?: string,
enabled?: boolean,
apiKey?: string,
fromName?: string,
fromEmail?: string,
replyToName?: string,
replyToEmail?: string,
): Promise<Models.Provider>

Update Sendgrid provider

Update a Sendgrid provider by its unique ID.

updateSms(
messageId: string,
topics?: string[],
users?: string[],
targets?: string[],
content?: string,
draft?: boolean,
scheduledAt?: string,
): Promise<Models.Message>

Update SMS

Update an email message by its unique ID.

updateSmtpProvider(
providerId: string,
name?: string,
host?: string,
port?: number,
username?: string,
password?: string,
encryption?: SmtpEncryption,
autoTLS?: boolean,
mailer?: string,
fromName?: string,
fromEmail?: string,
replyToName?: string,
replyToEmail?: string,
enabled?: boolean,
): Promise<Models.Provider>

Update SMTP provider

Update a SMTP provider by its unique ID.

updateTelesignProvider(
providerId: string,
name?: string,
enabled?: boolean,
customerId?: string,
apiKey?: string,
from?: string,
): Promise<Models.Provider>

Update Telesign provider

Update a Telesign provider by its unique ID.

updateTextmagicProvider(
providerId: string,
name?: string,
enabled?: boolean,
username?: string,
apiKey?: string,
from?: string,
): Promise<Models.Provider>

Update Textmagic provider

Update a Textmagic provider by its unique ID.

updateTopic(
topicId: string,
name?: string,
subscribe?: string[],
): Promise<Models.Topic>

Update topic

Update a topic by its unique ID.

updateTwilioProvider(
providerId: string,
name?: string,
enabled?: boolean,
accountSid?: string,
authToken?: string,
from?: string,
): Promise<Models.Provider>

Update Twilio provider

Update a Twilio provider by its unique ID.

updateVonageProvider(
providerId: string,
name?: string,
enabled?: boolean,
apiKey?: string,
apiSecret?: string,
from?: string,
): Promise<Models.Provider>

Update Vonage provider

Update a Vonage provider by its unique ID.