Skip Navigation

[Resolved] use an email adress posted on another page for notifications

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 6 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#746209
Imagen 3.PNG
Imagen 2-1.PNG
Imagen 2-0.PNG
Imagen 1.PNG

Tell us what you are trying to do?

I made a configuration page, where I want to add the emails for notifications of the cred forms

Is there any documentation that you are following?
No
Is there a similar example that we can see?
No
What is the link to your site?
I cant post it

#746691

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand - you want to send email notifications to the email IDs which is configured with your email configuration page - correct? If yes:

You can use CRED hook cred_notification_recipients in order to send email where you should fetch the required email IDs and set it with this hook to send email notification.

For example - Add following code to your current theme's functions.php file and adjust the code as required:

/**
 * Customise CRED notification recipients by adding a BCC
 * to the the notification "Content submitted"
 */
add_filter('cred_notification_recipients', 'modify_recipients', 10, 4);
function modify_recipients($recipients, $notification, $form_id, $post_id) {
    // Check notification name matches target notification
    if ( isset($notification['name']) && 'Content submitted' == $notification['name'] ) {
        // Add a BCC to log@emailaddress.com
        $recipients[] = array(
            'to'        =>  'bcc',
            'address'   => 'log@emailaddress.com',
            'name'      =>  '',
            'lastname'  =>  ''
            );
    }
    return $recipients;
}

More info:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_notification_recipients

#781440

I created a page called "configuration" for her I made a cred where there are personalized fields to enter emails, these emails I would like to receive the notifications of each new element, in total there are 21 forms, one to approve, one to edit and another to create, these 3 for a new element, in total there are 7 elements, therefore, 7 mail fields.
The portal I am creating is for 2 companies, so I take it that they are editable only in these fields and not in the fields of notifications for each cred created

#786619

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - as I understand you have CRED form where you have fields available where user will input the emails?

I see this screenshot: hidden link
I see the email ids with fields - where those fields are added to CRED form?

Could you please share problem URL and whole flow of your request and expected output , few screenshots will be helpful as well - that will help me to understand your issue better and I will be able to guide you in right direction.