Skip to content
Init is coming / May 19 - 23
Back

Email Messaging and Push Messaging are not WORKING

  • 0
  • Messaging
  • Cloud
Zionnite
31 Jan, 2025, 12:13

i have tried using the email messaging and push messaging of appwrite in the appwrite cloud, yet its not working, but everytime i run the code, i do get notification sent user but its not sending at all

TL;DR
Email messaging and push messaging are not working properly in the developer's code. They are facing issues with passing `targetArray` to the `target` object of the `messaging.createEmail()`. The developer needs to ensure they are using the `user` object correctly as well as handling the result of `find()` properly to send out email notifications successfully. Logs show errors related to invalid user parameters and incorrect handling of array elements in the code. Solution: Make sure to handle the result of `find()` correctly and pass the `user` object instead of a `targetArray` to `messaging.createEmail()`. Double-check the
Zionnite
31 Jan, 2025, 12:14

here is my error log

TypeScript
Notifications sent to user 2348148422710 with partnership status: true
Zionnite
31 Jan, 2025, 17:32

@Steven , yes i have done that, i no longer get this issues Failed to process user 2349034286339: Cannot read properties of undefined (reading 'length') but i'm email are not sending out yet i'm geting Notifications sent to user 2348148422710 with partnership status: true

Steven
31 Jan, 2025, 18:16

what does the message status and logs show?

Zionnite
31 Jan, 2025, 19:33

Yet, no email and push notification its received....

@Steven

Zionnite
31 Jan, 2025, 19:38

PROVIDER (firebase, sms, email)` is set on my console, User has subscribe and they all have their target.

sent a test message from console to user device via the Firebase Provider, user did receive the message, sent another text message from console to user email address via the email provider (mailGun), user did receive the email in their inbox.

but why is the function not working,

@Steven, why is this happening???

Steven
31 Jan, 2025, 19:49

you're not showing the details about the message from the Message section of your project in the Appwrite Console

Zionnite
31 Jan, 2025, 19:58
Zionnite
31 Jan, 2025, 19:58
Zionnite
31 Jan, 2025, 20:00
Zionnite
31 Jan, 2025, 20:01
Zionnite
31 Jan, 2025, 20:01

these are all mesage sent via the Appwrite Cloud Console

Steven
31 Jan, 2025, 20:05

so i assume you're not seeing new messages show up in the Messages table.

It's because your code is wrong. You're handing the result of find() wrong

Zionnite
31 Jan, 2025, 20:05

yes

Zionnite
31 Jan, 2025, 20:07

how do i fix that, can you please help me out on it

Zionnite
31 Jan, 2025, 20:13

@Steven

Zionnite
31 Jan, 2025, 21:28

hello, please i'm still anticipating your response

Steven
31 Jan, 2025, 21:45

i already told you. look at how you're using find()

Zionnite
31 Jan, 2025, 21:51

bro, this is the target for email {"$id":"6669064d0025cce36414","$createdAt":"2024-06-12T02:22:05.721+00:00","$updatedAt":"2025-01-28T07:45:38.773+00:00","name":"zionnite","userId":"2349034286339","providerId":"668295190028be64732b","providerType":"email","identifier":"zionnite@gmail.com","expired":false}

Zionnite
31 Jan, 2025, 21:53

its returning a valid target array, so what's happening.

Steven
31 Jan, 2025, 21:54

no...look at your code and your data again

Zionnite
31 Jan, 2025, 22:42

i'm no longer user TARGET i'm now using the user on the messaging.createEmail()

but this is the log output

TypeScript
Failed to process user 2349034286339: Invalid `users` param: Value must a valid array and UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and underscore. Can't start with a leading underscore
email Message: CREATED
Failed to process user 2348148422710: Invalid `users` param: Value must a valid array and UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and underscore. Can't start with a leading underscore
email Message: CREATED
Failed to process user 2349027243282: Invalid `users` param: Value must a valid array and UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and underscore. Can't start with a leading underscore
Zionnite
31 Jan, 2025, 23:44

what do you think of this @Steven

Zionnite
1 Feb, 2025, 11:59

Hello @Steven, using find() was not the issues, but i don't know why passing targetArray to the target object of the messaging.createEmail() was not working, but everything started working when i focus on using the user object in the messaging.createEmail() and you must pass the user array just pass in the userId with the angle bracelet,

Zionnite
1 Feb, 2025, 12:00

thanks @Airi The Chinchilla๐Ÿญ for showing concern for my issues

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more