Sending email notifications from the SchoalrX platform

Sending email notifications is a functional requirement of the ScholarX Platform.
@YohanAvishke @Gravewalker @piumal1999 Do you already have any plan on implementation?
I just went through some available Email APIs and came up with the following findings:

  1. Sendgrid
    Free quota: 100/day
    Java Library: Yes

  2. Mailgun
    Free quota: 5000/month but valid only for 3 months
    Java Library: Yes

  3. Fapimail
    Free quota: 100/day
    Java Library: No

Please add alternatives if you find any.

I saw this issue on the frontend repo. I think the emails shouldn’t be handled from the front end, but need to send it through the backend.
Downsides of having it on the frontend:

  • A simple mistake that happens from the frontend might jam everything. (Ex. Reloading the page while sending emails)
  • The mail credentials will be exposed to the frontend, which means someone can send emails as scholarX by doing some tweaks.

Usually these frontend emails clients are being used for implementations such as contact forms.

https://github.com/sef-global/scholarx-frontend/issues/95

cc: @anjisvj @EngTeam

2 Likes

+1 for @jaye’s comment. We should use spring-boot-starter-mail and existing APIs to complete this feature.

cc: @anjisvj

spring-boot-starter-mail seems better. We could use it even with Gmail! :blue_heart:

1 Like

This is the one I have used but it was just to get user feedback. But it can be done with this one also. nodemailer

Nodemailer is for NodeJS, right?

No, You can use it without NodeJs. BTW, we can use environment variable in that way we don’t have to expose our credentials

That’s interesting.
However, the problem is whether we are sending emails from the frontend or the backend.
PS:
Environment variables are secure if and if only they are accessible from the backend.
Also, we have the downsides I described earlier.

1 Like

I agree with @jaye! It is safer and extensible to handle email from the backend.

1 Like

yeah, I made a mistake with that library also. We need to create an API for that as well. I have use it with NextJs which allows you to create API’s within the frontend so our only option is going with the backend.

1 Like

+1 for spring-boot-starter-mail because it is independent of the service provider that we are going to use. Also, we could create a Google application password from our own accounts to test the application.

@YohanAvishke @anjisvj @Gravewalker How do we plan to execute the development of this task. How long will it take to have this functionality?

These are the functional requirements:

  • mentor_selection → mentee_application
    • Sending email notifications to the mentors with their status (approved or rejected)
  • mentee_application to mentee_selection
    • Sending email notifications to the selected mentors with a reminder to check their mentees. (no need to display mentees on the email at this stage)
  • Mentee_selection → Mentee_confirmation
    • Sending email notifications to the mentees who have been approved by multiple mentors with a reminder to pick their mentors (no need to display mentors at this stage)
  • Mentee_Confirmation → Ongoing
    • Sending email notifications to the mentors to check out their mentees. (sending the dashboard link would be sufficient. No need to list mentees)
    • Sending email notifications to the mentees to check out their mentor.
  • These emails don’t need to be fancy HTML emails at this stage. Having a plain text email is enough at this stage. We can improve it over time. :heartpulse:
  • Configuring it to work with google application password seems easier for testing. Define it as in the application.property file

These are the things that came into my mind at the moment. Please update the thread with your own suggestions.

2 Likes

Hi @jaye here you can find more suggestions and discussions we had before on the subject

Idea was to finalise the feature by the end of current sprint (deadline: 2021-04-16T18:30:00Z)

Oh I completely missed that thread.

image

The PR is ready for review.

@YohanAvishke

2 Likes