Enrica Falqui

Enrica Falqui
Born in Sardinia, now based in Berlin. Half of techno project Eris, half of ambient/experimental project Yhdessa.
/** * Newsletter Unsub Sync — RGPD cross-system compliance * * When someone unsubscribes via the Newsletter plugin (Stefano Lissa), * this syncs the unsub to wp_newsletter_unsubs (Claude Code publipostage table). * Ensures both mailing systems respect the same unsubscribe list. * * @since YIO 1.38.0 * @package YIO */if (!defined('ABSPATH')) { exit; }add_action('newsletter_user_unsubscribed', function ($user) { global $wpdb;if (empty($user->email)) { return; }$email = strtolower(trim($user->email)); $table = 'wp_newsletter_unsubs';// Check if already in Claude Code unsub table $exists = $wpdb->get_var($wpdb->prepare( "SELECT id FROM {$table} WHERE email = %s", $email ));if ($exists) { return; }// Insert into Claude Code unsub table $wpdb->insert($table, [ 'email' => $email, 'campaign_id' => 'newsletter_plugin_sync', 'unsub_date' => current_time('mysql'), 'ip_address' => '', 'method' => 'newsletter_plugin', ]);if (function_exists('yoyaku_log')) { yoyaku_log("Newsletter unsub synced to publipostage: {$email}", 'info', ['source' => 'yio']); } }); /** * Newsletter Unsubscribe Handler * Shortcode [ysc_newsletter_unsub] — processes unsub requests from email links */ add_shortcode("ysc_newsletter_unsub", function () { global $wpdb;$email_b64 = isset($_GET["email"]) ? $_GET["email"] : ""; $token = isset($_GET["token"]) ? $_GET["token"] : ""; $campaign = isset($_GET["c"]) ? sanitize_text_field($_GET["c"]) : "";if (empty($email_b64)) { return "
Missing email parameter.
Invalid email address.
Invalid token. Please use the link from your email.
You have been unsubscribed from our mailing list.
You will no longer receive promotional emails from Yoyaku Record Store.

Born in Sardinia, now based in Berlin. Half of techno project Eris, half of ambient/experimental project Yhdessa.