firebase / extensions

Source code for official Firebase extensions
https://firebase.google.com/products/extensions
Apache License 2.0
882 stars 372 forks source link

🐛 [firestore-send-email] The `delivery.info` entry is missing after upgrading to 0.1.32. #2004

Closed KoheiKanagu closed 2 months ago

KoheiKanagu commented 3 months ago

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs for a specific extension in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

[REQUIRED] Step 2: Describe your configuration

[REQUIRED] Step 3: Describe the problem

After upgrading to 0.1.32, delivery.info.accepted, delivery.info.messageId, delivery.info..response is missing.

Steps to reproduce:

  1. Upgraded to 0.1.32
Expected result

delivery.info should not be missing.

Actual result

v0.1.31 スクリーンショット 2024-03-26 16 06 18

v0.1.32 スクリーンショット 2024-03-26 16 06 42

pr-Mais commented 3 months ago

I can reproduce, looking into it.

Aconcagua-CTO commented 3 months ago

Hi guys, not sure if this is related. I upgraded from 0.1.29 to 0.1.32 yesterday, and my mails are failing with "Error: String expected for text" image

I send my messages using html, and always kept text: null. This was working on 0.1.29, but not on 0.1.32.

I'll keep testing on my side and let you know if I find anything else.

Regards

pr-Mais commented 3 months ago

@Aconcagua-CTO are you using sendgrid?

Aconcagua-CTO commented 3 months ago

Yes

pr-Mais commented 3 months ago

Tried with the following and it was sent successfully (using SendGrid)

Screenshot 2024-03-26 at 5 44 21 PM

pr-Mais commented 3 months ago

It seems that when using https://www.npmjs.com/package/nodemailer-sendgrid the response doesn't include a delivery info in the response & it uses SendGrid v3 API, which I used in the newest version for SendGrid as it enabled using Dynamic Templates.

Aconcagua-CTO commented 3 months ago

In my case, I'm using emailTemplates collection to populate my emails. I just confirmed that the template now needs non-empty text field to work. On production, extension is 0.1.29 and text field is not in the emailTemplate collection, emails are sent without problem.

On 0.1.32 I tested with a null text field image It failed Tested an empty string and it failed image

Now I'm testing a single space and it's working again image

Seems we have separate issues :D

pr-Mais commented 3 months ago

@Aconcagua-CTO interesting, might also be related to the last update to SendGrid, checking now.

pr-Mais commented 3 months ago

@Aconcagua-CTO I faced some issues using the templates collection as well, mostly caused by the new SendGrid transporter. We can get back the old transporter which appears to use SendGrid v2, but this will remove the support for Dynamic Templates. Thinking of introducing a new param for users who would like to use v3.

Aconcagua-CTO commented 3 months ago

Sorry to hear that. I'm fine with my workaround for now. I don't use sendgrid templates. And the space in the text field shouldnt cause problems if you revert the change.

New param sounds good.

Regards

On Tue, Mar 26, 2024, 1:14 PM Mais Alheraki @.***> wrote:

@Aconcagua-CTO https://github.com/Aconcagua-CTO I faced some issues usiNewng the templates collection as well, mostly caused by the new SendGrid transporter. We can get back the old transporter which appears to use SendGrid v2, but this will remove the support for Dynamic Templates. Thinking of introducing a new param for users who would like to use v3.

— Reply to this email directly, view it on GitHub https://github.com/firebase/extensions/issues/2004#issuecomment-2020861555, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3OX2PRHZJR2R3MZGN7BN3LY2GNFZAVCNFSM6AAAAABFILNJHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRQHA3DCNJVGU . You are receiving this because you were mentioned.Message ID: @.***>

belwalravi commented 3 months ago

Hi @Aconcagua-CTO @pr-Mais @KoheiKanagu , I am also facing a similar kind of issue, after upgrading to the latest version of the extension I am not able to send mails, while using collection templates but with the previous version It was working. Can someone assist with this?

Screenshot 2024-04-04 at 6 34 01 PM
Aconcagua-CTO commented 3 months ago

Hi @belwalravi did you try adding a field "text" with a single space? Look at my past message.

belwalravi commented 3 months ago

Yes @Aconcagua-CTO I read those comments. Could be please let me know how will the object be looking in my case with text. I mean where should I place this text.

Screenshot 2024-04-04 at 7 51 39 PM
Aconcagua-CTO commented 3 months ago

In my case I'm using it on the emailTemplates collection I added a field on each document The field name is "text" The value is " " Like this image

Hope it helps

belwalravi commented 3 months ago

Hi @Aconcagua-CTO This is how my template collection doc is. If you are talking about this? Do you mean I should keep the text field here?

Screenshot 2024-04-04 at 8 03 23 PM
belwalravi commented 3 months ago

Thanks @Aconcagua-CTO bro it helped. Mail are getting delivered now. Now we need to add a text field with a space to get your code working.

Aconcagua-CTO commented 3 months ago

Yes, that was the collection I was referring to. Glad to help!