waumsley
(David Waumsley)
1
I was given some help with this in the Beaver Builder Facebook group with this:
$('.submitbutton').on('click',()=>{
$('.textarea').text = $('.textarea').text + document.title;
});
Not knowing JS, but seeing an error I changed it to this:
(function($) {
$('.fl-button').on('click',()=>{
$('.fl-message').text = $('.fl-message').text + document.title;
})(jQuery);
No joy, but wondering if it is possible?
pross
2
This is easier in PHP … should have just asked me first 
add_action( 'wp_ajax_nopriv_fl_builder_email', function() {
$post_id = sanitize_text_field( $_POST['post_id'] );
if ( $post_id ) {
$title = get_the_title( $post_id );
// inject title
$_POST['message'] .= "\n\n" . 'Sent from: ' . $title;
}
}, 9 );
1 Like
waumsley
(David Waumsley)
3
This is like magic to me. Brilliant, thank you so much once again.
If anyone else is using just note I needed to be logged out of WP for it to work.
pross
4
If you add the same code tp wp_ajax_fl_builder_email
action it’ll work logged in 
1 Like
system
(system)
Closed
5
This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.