Configuring SDI sending via PEC
Goal
Send valid electronic invoices (B2B and B2C) to the Sistema di Interscambio (SDI, Italy’s Exchange System) via a PEC mailbox (Posta Elettronica Certificata, Italy’s certified email), using the SDI via PEC addon.
Prerequisites
- The SDI via PEC addon installed and active.
- A PEC mailbox with SMTP access (host, port/security, username, password).
- Only one invoice-sending integration can be active at a time: deactivate Fatture in Cloud or Aruba before activating this one.
Steps
1. Configure the PEC mailbox (SMTP)
In the plugin’s SDI via PEC tab, enter your PEC mailbox parameters: SMTP host, connection security type, username and password. The plugin also tracks a password expiration date, useful as a reminder to renew it before it stops working.
If your PEC provider requires two-factor authentication for SMTP access (e.g. Aruba PEC), you’ll need to generate a dedicated application password from the provider’s panel (for Aruba PEC: account management > Password for mail programs) and use that instead of the normal password — this is a requirement of the PEC provider, not a plugin setting.
2. Verify/customize the SDI recipient address
The PEC recipient address for the Sistema di Interscambio field defaults to
sdi20@pec.fatturapa.it; you can only override it if your case requires a different address. Note:
this field, along with “Password for the sender’s PEC address” and “Username for the sender’s PEC
address” further down, is shown in Italian in the plugin UI regardless of the site’s language — there
is no English label for these specific fields.
3. Configure automatic sending
- Order status that triggers sending (“Enable auto-send for status:”) — defaults to “Completed”, can be set to another WooCommerce order status.
- Enable automatic sending (“Enable automatic sending”) — when a configurable delay in hours (default 12 hours) elapses after the configured status is reached, the invoice is sent via PEC to the SDI.
WP-Cron reliability
Automatic events depend on WP-Cron, which only fires with traffic on the site. If your site gets little traffic, add a system Cron job (e.g. every 30 minutes):
cd <document_root>/public_html; wp cron event run --due-now >/dev/null 2>&1
Diagnostic log
To trace scheduling and execution of sends, add this to wp-config.php:
define("WP_FATT_SDI_LOG", true);
Manual sending
Use the “Send” button on the invoice to transmit it immediately via PEC; the plugin marks it as sent once the operation completes.
Verify
Check the configured PEC mailbox: it must show the message sent to the SDI recipient, and the invoice in the plugin must show as sent.
Common errors
- The SMTP connection fails with “invalid credentials” — if you’ve enabled two-factor authentication on the PEC mailbox, the normal password isn’t enough: generate a dedicated application password.
- Automatic sending doesn’t start — check WP-Cron/the system Cron job first; it’s the most common cause.
- The SMTP password has expired — the plugin tracks the expiration date you entered: if the provider changed it, update it in the SMTP configuration.
Related configuration
For the native alternative without a PEC mailbox, see sdi-via-pop. To understand an SDI rejection, see sdi-invoice-rejected.