> Well, i did what you said, and that worked, but i can't select the e-mail address of the addressed artists in the e-mail notification field. I can only select the senders' e-mail address, and i don't want the e-mail to go there. 🙁 I also tried the [wpv-post-author format="meta" meta="user_email"] shortcode in the "Send notification to a WordPress user: " field.
- I see that with the 'Contact Verzoeken' post type there is just one email type custom field ( 'e-mail adres' ) registered for the sender's email.
For the artist's email, there is no email type custom field added, instead, a generic email field is being used. The value of the generic fields is not saved/recorded with the created post and it is also not available in the form notification's settings.
You can add another email-type custom field in the custom field group 'Post Field Group for contactform' and use that in the form in place of the generic email field. After this change you'll be able to use that field in the form notification's 'To' settings.
> Also, the sender's e-mail address should be used for sending the message, so that the artists can simply reply to the e-mail. Is that possible? I can imagine though, that this might interrupt e-mail traffic because then the website is sending e-mails with different senders domains.
- In the form's email notification settings there is no built-in option to set a dynamic 'From' email address. That is due to the reason that you mentioned, that sending out emails from different domains, affects email deliverability.
Alternatively, you can use the 'cred_mail_header' hook ( ref: https://toolset.com/documentation/programmer-reference/cred-api/#cred_mail_header ), to dynamically set the 'sender's email' into the 'Reply-To' header, so that when the received email is replied to, it will automatically use the sender's email address for the 'To' address.
You'll find an example code snippet for a similar usage in the following forum thread:
https://toolset.com/forums/topic/emails-from-a-toolset-form-needs-to-reply-to-the-person-who-submitted-it/
> Also i'm trying to make the created posts available for only the artist that it is addressed to, or is that not the idea of this? It would be great it the artist can few his/her messages on the website and simply click on reply.
- Just as you'll be storing the 'Contact Request Artist Email' with each created 'Contact Verzoeken' post you can add a numeric custom field 'Contact Request Artist ID' and store the addressed artist's user ID too.
( for the default value in the form, you'll use the shortcode [wpv-post-author format="meta" meta="ID"] )
Storing the addressed artist's user ID with each contact request will allow you to:
a). Use the conditional block to show the content of the message only to the addressed artist on the single 'Contact Verzoeken' post pages,
( i.e. show the content only if the 'Contact Request Artist ID' is the same as the current user's ID )
and
b). To show the list of all messages sent to a particular artist, through a post view with a custom field filter based on the field 'Contact Request Artist ID'.
( i.e. show all 'Contact Verzoeken' posts where 'Contact Request Artist ID' is the same as the current user's ID )