Custom Development / Part Synergy Custom Integration / Part Synergy Custom Email Script

Part Synergy Custom Email Script

Version Date Name Applied changes
v1.0 09.06.2025 Bogomil Pavlov First Publish

Objective:

Develop a custom script that automates the processing of incoming emails by identifying specific recipients or subjects, extracting their attachments, and transferring them to designated FTP directories. After successful transfer, the email will be deleted from the inbox to maintain a clean environment.


Key Requirements:

  1. Email Monitoring & Filtering
    • Monitor an inbox directory for incoming emails.
    • Filter emails based on:
      • Recipient email address
      • Email subject
      • Or a combination of both
  2. Attachment Handling
    • Automatically extract and upload all email attachments to a predefined FTP path.
    • Delete the email after successful file transfer.
  3. Warehouse Integration
    • Multiple Part Synergy warehouses will utilize this setup.
    • FTP credentials will be configured accordingly to support multiple warehouse folders and routing.
  4. Configuration Constraints
    • Email address is internal and controlled, allowing for hardcoded values in the script.
    • FTP servers are also internal. While the root credentials remain the same, destination folders will vary depending on the email context.

FTP Integration Details:

FTP Credentials > Root Directory

This will be derived from:

Examples:

  • Email only: bpavlov@threecolts.com
  • Subject only: Dorman Shipping Notification
  • Combined: bpavlov@threecolts.com | Dorman Shipping Notification

FTP Credential Type:

Email Shipping Notifications

  • FTP Path: This defines the target directory where attachments should be uploaded.
  • FTP Path > Label: Email Attachment

SMTP details:

$emailHost = '{imap.gmail.com:993/imap/ssl}INBOX';
$emailUser = 'mcp-feeds@threecolts.com';
$emailPass = 'zxsz jgxk mmri ikqe'; // App password
Is this article helpful?
0 0 0