Custom mail tags
-
Hi,
i programmed special function, that takes trial keys out of DB and show them in custommers email. I would like to ask, if is it possible to somehow get my special tag called [trial-klic] to google sheets?
Snippet of the code looks like this:add_filter('wpcf7_special_mail_tags', function($output, $name, $html) { if ('trial-klic' == $name) { $conn = new mysqli("localhost","db","db_pw","db_name"); $query = "SELECT * FROM "table" ORDER BY Key DESC LIMIT 1"; $result = mysqli_query($conn, $query); $row = mysqli_fetch_assoc($result); $data = $row['Key']; $sql_del = 'DELETE FROM table ORDER BY Key DESC LIMIT 1'; mysqli_query($conn, $sql_del); mysqli_close($conn); return $data; } return $output; }, 10, 3);
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Custom mail tags’ is closed to new replies.