BuddyDev

Search

Send Birthday Greeting to User’s Email on their Birthday

  • Participant
    Level: Initiated
    Posts: 14
    Cordial on #51032

    BuddyPress has Emails by default, and we create these Emails normally as we create a normal Post in WordPress.

    But these Emails are triggered by Situations, as you can see here– https://prnt.sc/iPp4iPfC5zvE

    Do you have a Code Snippet that can create a Custom Situation— and this situation is triggered to send an Email to the registered Email Address of users when it is their Birthday?

    2.) This is a Code Snippet that someone gave me– https://pastebin.com/NE9VjTPd

    It is to be useful in Sending a Birthday Message to Users on the day of their Birthday.

    Which part of this code do I add my full Email content?

    Can you just please show me an example?

    Regards.

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #51048

    Hi Cordial,
    1. Please do not use that code! it won’t scale at all. It is a bad idea to fetch all users in one query.

    2. in case of BuddyPress, they have certain API where you create/install email content with your custom content. We can point you to that direction(though It needs to be in the form of plugin or some code that runs only once to install to avoid overhead), but first, I will not suggest using the current code you have and I apologize in advance for my lack of time to assit you with ay code sendting birthday message.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved