A way to deliver information to users by mail

First of all, goes my scenario and what I want to accomplish: I have a website for a private elementary school. In there I have two custom post types: notice and homework.

Each time I publish a notice, I want all the parents to receive it (a group of users) as soon as it is available (the fact that it can be scheduled to a fixed time would be a plus).

On the other end are the homeworks: each teacher captures the homework for its group of students. At the end of the day, a group may have five homeworks. Therefore, I do not want the mail to fire five times, but I want a mail with the homework of the day to be sent at the end of work day (a fixed time).

For the first one problem, I had considered eNewsletter, since it is only one Notice. However, is there a way to automatically create one from each Notice? Or posibbly convert the newsletter to the notice custom type? Or is its application for other uses? Also Jetpack suscription exists, but that works only for regular posts. Is there anything that sends by mail a custom post type upon its publishing?

The second problem need more thought since it involves more logic. First, we are talking about sending all the content available at a fixed time (possibly CRON or something). Second, we are talking about a filter by the date of today. And third, and most complex, the filter has to send the ones related only to that group: for instance, 'group of users A' receives the homework of first grade, and 'group of users B' receives homework of second grade. Therefore, the filter needs to receive the value of a custom field in order to filter.

So, first problems gets solved with automatic sending of custom post type to mail.

Second gets fixed with a lot of stuff, but I assume possibly the advice given for first is going to help.

I wonder, is there a plugin that can assist me on this tasks? Or it all boils down to custom coding? (for the second part I think it is, but maybe first one...)

I am open to suggestions. I just want to know if there is an easier way before walking into the functions.php way with custom code.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Carlos Ramos,

    I hope you are well today and thank you for your question.

    For the first one problem, I had considered eNewsletter, since it is only one Notice. However, is there a way to automatically create one from each Notice?

    Also Jetpack suscription exists, but that works only for regular posts. Is there anything that sends by mail a custom post type upon its publishing?

    Currently it's not possible without custom coding but you can try using our Subscribe by Email plugin that has this functionality.

    Or posibbly convert the newsletter to the notice custom type? Or is its application for other uses?

    You will have to develop custom code to achieve it.

    The second problem need more thought since it involves more logic. First, we are talking about sending all the content available at a fixed time (possibly CRON or something). Second, we are talking about a filter by the date of today. And third, and most complex, the filter has to send the ones related only to that group: for instance, 'group of users A' receives the homework of first grade, and 'group of users B' receives homework of second grade. Therefore, the filter needs to receive the value of a custom field in order to filter.

    I think you can achieve this using eNewsletter plugin by creating membership groups and setting CRON

    You will find more information about these plugins on the following pages.
    https://premium.wpmudev.org/project/e-newsletter/#usage
    https://premium.wpmudev.org/project/subscribe-by-email/#usage

    Kind Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.