ItzNotABug / ghosler

Send newsletter emails to your Ghost CMS subscribers & members, using your own email credentials!
Apache License 2.0
47 stars 5 forks source link

Support Newsletter Feedbacks #10

Closed ItzNotABug closed 9 months ago

ItzNotABug commented 9 months ago

Building on the discussion in issue #2, I've reconsidered the approach to managing newsletter feedback. Initially, I was confused about data consistency when saving feedback both in Ghost and Ghosler. However, a more streamlined solution can be used.

Ghost conveniently collects newsletter feedback using a specific URL format. This allows us to directly access feedback and sentiment data through the Ghost Admin API.

URL format -

https://{siteUrl}/#/feedback/{postID}/{feedbackType}/?uuid={memberUUID}

Here, feedbackType can be 0 (More like this) or 1 (Less like this).

We should focus on these fields in our API requests: -


Flow

  1. A member clicks a feedback option (e.g., "More like this").
  2. They are redirected to the specified URL, with the appropriate feedbackType.
  3. Ghost presents a confirmation popup or sheet to the member.
  4. Ghosler retrieves this feedback data, using it for analytics and dashboard displays.
ItzNotABug commented 9 months ago

Hey @viriatusX 👋, The support for newsletter feedback is also added now, currently in the feedback-support branch.

ItzNotABug commented 9 months ago

This feedbackType flag gave me a good confusion, multiple times.

Looking at the Ghost's impl. I see: Like = 1, Dislike = 0

Reference: https://github.com/TryGhost/Ghost/blob/efb2b07c601cd557976bcbe12633f072da5c22a7/ghost/email-service/lib/EmailRenderer.js#L1000C9-L1009

viriatusX commented 9 months ago
Captura de pantalla 2023-12-21 a las 19 08 29

The new branch not work correctly (in my case). Look the error. When I start Ghosler, I go to Settings, modify Newsletter Settings and it does not work "save" or anything else. Then it shows this error and the app stops working showing this error.

ItzNotABug commented 9 months ago

@viriatusX, Unable to reproduce, can you post the contents of ghosler logs error?

viriatusX commented 9 months ago

I reinstalled it with "sudo" in my Ubuntu VM and everything is fine. But I don't receive the newsletters to my email. I have checked absolutely everything and it is correct. "Error logs" shows nothing and "Debug Logs" shows everything correctly. But the email does not arrive. I have tried 2 different SMTP servers and nothing.

ItzNotABug commented 9 months ago

I reinstalled it with "sudo" in my Ubuntu VM and everything is fine. But I don't receive the newsletters to my email. I have checked absolutely everything and it is correct. "Error logs" shows nothing and "Debug Logs" shows everything correctly. But the email does not arrive. I have tried 2 different SMTP servers and nothing.

I've identified a few issues myself. Would be fixed by tomorrow I guess, once the webhook_support branch is complete.

Thanks for the feedback.

ItzNotABug commented 9 months ago

Hey @viriatusX 👋, The latest release (0.6) should work fine. Tested with a clean install, seems to be working fine now.

viriatusX commented 9 months ago

Hey @viriatusX 👋, The latest release (0.6) should work fine. Tested with a clean install, seems to be working fine now.

Now all works perfectly! Thanks!!

Happy Christmas 🎄

viriatusX commented 9 months ago

Hello! I have used Ghosler in real production for the first time. Many users do not receive the email. I attach the "error logs".

Captura de pantalla 2023-12-24 a las 11 45 23

[2023-12-24 10:28:36 UTC] => [ERROR] => Newsletter: Error: Data command failed: 421-4.3.0 Temporary System Problem. Try again later (10). For more information, 421-4.3.0 go to 421 4.3.0 https://support.google.com/a/answer/3221692 g3-20020a05600c310300b0040c6b2c8fa9sm21226207wmo.41 - gsmtp at SMTPConnection._formatError (/home/juani/Escritorio/node_modules/nodemailer/lib/smtp-connection/index.js:790:19) at SMTPConnection._actionDATA (/home/juani/Escritorio/node_modules/nodemailer/lib/smtp-connection/index.js:1678:34) at SMTPConnection.<anonymous> (/home/juani/Escritorio/node_modules/nodemailer/lib/smtp-connection/index.js:1650:26) at SMTPConnection._processResponse (/home/juani/Escritorio/node_modules/nodemailer/lib/smtp-connection/index.js:969:20) at SMTPConnection._onData (/home/juani/Escritorio/node_modules/nodemailer/lib/smtp-connection/index.js:755:14) at SMTPConnection._onSocketData (/home/juani/Escritorio/node_modules/nodemailer/lib/smtp-connection/index.js:193:44) at TLSSocket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at Readable.push (node:internal/streams/readable:234:10)

ItzNotABug commented 9 months ago

@viriatusX Can you create a new issue to keep a better track?