Skip to content
post

Create email

Endpoint

posthttps://<REGION>.cloud.appwrite.io/v1/messaging/messages/email

Description

Required scopes

messages.write

Authentication

Initialize the Appwrite client with setProject() and a server API key (setKey()). For direct REST calls, send X-Appwrite-Project and X-Appwrite-Key.

Parameters

string
Required
string
Required
string
Required
array
array
array
array
array
array
boolean
boolean
string
string
string
array
Status
Content type
201
application/json

Message

Name
Type
Description
string
string
string
string
arrayof string
arrayof string
arrayof string
string
string
arrayof string
integer
object
draft | processing | scheduled | sent | failed
Python
from appwrite.client import Client
from appwrite.services.messaging import Messaging
from appwrite.models import Message
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
client.set_key('<YOUR_API_KEY>') # Your secret API key
messaging = Messaging(client)
result: Message = messaging.create_email(
message_id = '<MESSAGE_ID>',
subject = '<SUBJECT>',
content = '<CONTENT>',
topics = [], # optional
users = [], # optional
targets = [], # optional
cc = [], # optional
bcc = [], # optional
attachments = [], # optional
draft = False, # optional
html = False, # optional
scheduled_at = '2020-10-15T06:38:00.000+00:00', # optional
reply_to_email = '[email protected]', # optional
reply_to_name = '<REPLY_TO_NAME>', # optional
emails = [] # optional
)
print(result.model_dump())