Send automatic emails to qualified candidates

I need to create the ability to send emails to select individuals who sign up on my website.
Once an applicant is marked as “qualified” I need Wix code to generate a email that is sent to that person.

The email will contain a link to collect a video interview.

How may I go about this?

Hey Anthony,

First off, how is the applicant going to be marked as “qualified”? That will affect how you trigger the email.

To get started, you might want to read this article about sending an email on form submission (the link is below). You’ll need to do something similar but trigger the email when the applicant is marked as “qualified” instead of when a form is submitted.

Let us know how it’s going and we will be happy to help you out.

1 Like

Hi Sam,

I would like to have a field in the database collection that I can update to a certain value, that prompts the database to send an email.

Is that possible? Would that be the most efficient way to accomplish this?

You should be able to do that with an afterUpdate hook.

Basically, you want to take the example from the send on form submit and modify it to work with a data hook.

Here’s some initial guidance:

  • You don’t need to create the form.

  • You will need to create the backend functions as described in the form submission example.

  • In the afterUpdate hook on your collection you want to check the value of the proper field to see if it was updated to qualified

  • If it has, you want to use code similar to the event handler code in the form submission example to send the email.

Here’s some reading on hooks:

Another idea, instead of the hooks, would be to create an admin page (maybe password protected) with a button that “qualifies” candidates. (There will be some setup involved to get a button to qualify a specific applicant.) Then you can use the event handler code from the form submission example in the button’s onClick.

Hope this helps. Let us know how it’s going.

1 Like

Interesting ways to go about this :slight_smile:

I will determine the best way to implement this and take it from there!