You can try use something like this filter:
<?php
add_filter( 'ctz_post_request_args', $args );
function discord_ctz_post_request_args( $args ) {
$body = json_decode( $args['body'] );
// Add your own validation to change only this form
if ( empty( $body ) ) {
return $args;
}
$discord_body = array(
'content' => 'New message from ' . $body['name'] . 'on your website.',
'embeds' => array(
"title": "Contactform",
"description": sprintf( "**Discord-Tag:** %s\n**E-Mail:** %s\n\n**Message**\n%s", $body['discordtag'], $body['email'], $body['message'] ),
"color": 9291330,
"author": array(
"name": $body['name'],
"icon_url": "https://ennorath.org/wp-content/uploads/2020/03/mail.png",
),
),
);
$args['body'] = json_encode( $discord_body );
return $args;
}
I was not able to test or validate any input, so add this, please.
You should change “name”, “discordtag” and other $body['field-ids']
to match your own fields.
I hope this can help you.