Skip Navigation

[Resolved] CRED Notification

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.

This topic contains 12 replies, has 3 voices.

Last updated by Vanja Šebek 6 years, 10 months ago.

Assigned support staff: Ana.

Author
Posts
#228104

Thanks for the great plugin.
I have created a custom post called Preschool for adding listings of schools.There is a custom field for e-mail too. I want visitors to contact school directly through a form.
For this I have created another custom post with the name Contact Preschool. I have created a CRED form associated with the new custom post. Here the visitors can fill up the details and post. I (Author) am able to receive notification mails. when someone posts messages. But, I am unable to send the notification to the e-mail id present in the Preschool fields.
Please let me know how I can do this. I am not comfortable with coding. Is there is a simpler solution where I can retrieve the e-mail field from Preschool and send notification? Should I assign any parent child relation?

#228126

Ana
Supporter

Dear indianplayschools,

My suggestion in order to achieve what you specify would be to set a parent child relationship between the post types, use a View to retrieve the email from the parent post based on a URL parameter and use the cred child link to create the contact preshool post coming from the preschool page.
Explaining how this can be done:

1. set the parent relationship in Types between the two custom post types 'Preschool' and 'Contact Preschool' so that 'Preschool' is parent to 'Contact Preschool'.
2. you mentioned that the 'Preschool' custom post type had also an email field associated to it and this is the email of the preschool to be used in the notification.
3. create a View that will list 'Preschool' and add a query filter where we it will 'Include only posts with IDs determined by the URL parameter "parent_preschool_id" eg. yoursite/page-with-this-view/?parent_preschool_id=1'
4. in the Layout HTML/CSS/JS of the View add the shortcode to display the email field

[wpv-layout-start]
[wpv-items-found]
<wpv-loop>[types field="preschool-email" output="raw"][/types]</wpv-loop>
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]<strong>No email provided</strong>[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

note: make sure that there are no spaces in the beginning of each line in this section.
5. save the View, for this example we have set the name has 'preschool email field'
6. create a CRED form to create content of type 'Contact Preschool' and add the necessary fields to the contact form along with a CRED generic field of type email where the default value of this field will be the View previously created, so we get the email of the Preschool.

[cred_generic_field field="_wpcf_preschool_email" type="email" class="" urlparam=""]
{
"required":0,
"validate_format":0,
"persist":1,
"default":"[wpv-view name="preschool email field"]"
}
[/cred_generic_field]

7. in CRED notifications settings 'Where to send this notification' choose 'Send notification to an email specified in a form field' and select the generic field just created, in this example would be '_wpcf_preschool_email'
8. save the CRED form.
9. now you can use this logic in the following manner:
create a page and add the CRED form shortcode for creating 'Contact Preschool'

[cred_form form="create a contact preschool"]

10. in each preschool page add the link for this page considering it a CRED child link, for this you will need to specify the ID of the page that was previously created and has the actual form, in this example this page has id '161'

[cred_child_link_form form="161" parent_id="-1" text="contact this preschool" target="_self"]

And it's done, visit a preschool page and click the link it should display the CRED contact preshool form with the email to be used in the notifications.

Note: if you would not want to display the email publicly you can wrap the cred generic field with a div element with style="display:none;" this will hide the field but at the same time make it available to the notification.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Ana

#228227

Thank you very much for your detailed reply. Will work on this and reply tomorrow.

#228246

Ana
Supporter

Dear indianplayschools,

your welcome and let me know if I can help you with any other questions you might have.

Regards,
Ana

#228366

Thank you for your support.
I could execute well till the 9th step. I created page where I have called the CRED form. When I go to a preschool page and paste the code specified by you in the 10th step, I get a message saying " No child page form specified" can seen while viewing the preschool page . I have replaced the page id (161)by the post id of the page where I had called the CRED form. Is there anything else that I need to do?

#228370

Ana
Supporter
Screen Shot 2014-07-02 at 09.15.01.png

Dear indianplayschools,

please try the following instead of copy paste the shortcode I provided, in the preschool page when editing in WP admin click on the CRED icon provided above the content box and follow the GUI there in the popup window to add a CRED child content link.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Ana

#229288

Thanks for the support. I could succeed in placing the child link form in preschool page. But, my mails are not reaching preschool mail box. Followed same steps given by you. Do not know where I am going wrong. Thank you for your support

#229347

Ana
Supporter

Dear indianplayschools,

I need to request temporary access (wp-admin and FTP) to your site – preferably to a test site where the problem has been replicated if possible – in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Thanks,
Ana

#229549

Thank you for your kind support.

I have created a custom post Preschools which enters the preschool data.
I have created another custom post for cred forms called contact preschools
I have control preschools child of Preschools
I have created custom fields for "contact preschools" where I have entered the necessary fields that the visitor has to fill up.
I created a view by name : show preschool email
I have created a CRED form "forsendingemailtopreschool" for "contact preschools.
Now I have tried to retrieve the email ID of the preschool. It appears in the notification also.
I have created a page "hidden link". Here I have placed the CRED form.
I have created a preschool by name XXXX show preschool hidden link
I am able to get mails to my inbox by clicking on Send notification to Author. But, the mails to the preschool entered are not being received to my other mail id given in the preschool field.
Thanks a lot for your kind support

#229674

Can you please remove my login details from above or can I delete my last comment. I have given my login details in the post itself. Please remove this urgently.Thank you

#229701

Ana
Supporter

Dear indianplayschools,

the CRED child link was missing the text attribute and so you were not being able to see it in the page

[cred_child_link_form form="16735" parent_id="-1" text="for mailing preschool" target="_self"]

And once your using a Views Content Template I would suggest that the CRED shortcode be added there instead of in the Preschool content directly. This way is used and available for all Preschools that have the Content Template applied.

One other think is that in the View that will retrieve the emails the query filter should be to "Include only posts with IDs determined by the URL parameter "parent_preschool_id" eg. yoursite/page-with-this-view/?parent_preschool_id=1"

Also the generic field used to display the email in the CRED form for contact school should be

[cred_generic_field field="_wpcf-e-mail-id" type="email" class="" urlparam=""]
{
"required":0,
"validate_format":0,
"persist":1,
"default":"[wpv-view name="show preschool email"]"
}
[/cred_generic_field]

Could you test I think all should deb working and the notifications should be sent to the school email.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Ana

#229740

Job done! Thank you very much Ana Couto. My whole website stands on the shoulders of Toolset. You have always been very supportive. I will try to give the same kind of support to my clients who purchase my products. Thanks for all your patience and making me understand everything. Thanks a zillion.

#353746

Hello,

I try to achieve the same result as described in this topic but the e-mail just did nost sent to the e-mail defined in the parent post (slug: fahrleitung-stelle)

I created a view for the mail and queried like that (name of the view is Farhleitung Ansprechpartner View):
query filter: ihreseite/seite-mit-dieser-view/?parent_fahrleitung-stelle_id=1

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>[types field="ansprechpartner-e-mail" output="raw"][/types]</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]keine e-mail[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

CRED shows the e-mail I want but no mail could be sent to the mail from the parent post:
[cred_generic_field field="ansprechpartner-e-mail" type="email" class="" urlparam=""]
{
"required":0,
"validate_format":0,
"persist":1,
"default":"[wpv-view name="farhleitung-ansprechpartner-view"]"
}
[/cred_generic_field]

Thanks in advance for your help.

Best regards,

Boris