### Get All HTML Templates Source: https://context7.com/dashamail/php_dashamail/llms.txt Fetches all saved HTML templates for the user. No parameters are needed to retrieve all templates. ```php campaigns_get_templates(); ``` -------------------------------- ### Automate Email Marketing Workflow with PHPDasha Source: https://context7.com/dashamail/php_dashamail/llms.txt A comprehensive example showing the full lifecycle of an email campaign, from list creation to subscriber management and performance reporting. ```php lists_add('Клиенты интернет-магазина', array( 'company' => 'ООО Мой Магазин', 'abuse_email' => 'admin@myshop.ru' )); $listId = $listResult['list_id']; // 2. Добавляем подписчиков $subscribers = array( array('email' => 'user1@example.com', 'name' => 'Иван'), array('email' => 'user2@example.com', 'name' => 'Мария'), array('email' => 'user3@example.com', 'name' => 'Пётр') ); foreach ($subscribers as $sub) { $dasha->lists_add_member($listId, $sub['email'], array( 'merge_1' => $sub['name'] )); } // 3. Создаём рассылку $campaignResult = $dasha->campaigns_create(array($listId), array( 'name' => 'Летняя распродажа', 'subject' => 'Скидки до 70% только сегодня!', 'from_name' => 'Мой Магазин', 'from_email' => 'news@myshop.ru', 'html' => '
Только сегодня скидки до 70%!
Отписаться от рассылки ' )); $campaignId = $campaignResult['campaign_id']; // 4. Получаем статистику после отправки $summary = $dasha->reports_summary($campaignId); echo "Отправлено: " . $summary['sent'] . "\n"; echo "Доставлено: " . $summary['delivered'] . "\n"; echo "Открыто: " . $summary['opened'] . "\n"; } catch (Exception $e) { echo "Ошибка: " . $e->getMessage(); } ``` -------------------------------- ### Get Campaign Attachments Source: https://context7.com/dashamail/php_dashamail/llms.txt Retrieves a list of all files attached to a specific campaign. The campaign ID is required. ```php campaigns_get_attachments('54321'); print_r($attachments); // Результат: массив с информацией о прикреплённых файлах ``` -------------------------------- ### Get Campaign Summary Statistics Source: https://context7.com/dashamail/php_dashamail/llms.txt Retrieves a summary of statistics for a campaign, including total sent, delivered, opened, and clicked counts. ```php reports_summary('54321'); print_r($summary); // Результат: общее количество отправленных, доставленных, открытых, кликов и т.д. ``` -------------------------------- ### Get Delivered Emails List Source: https://context7.com/dashamail/php_dashamail/llms.txt Fetches a list of emails that were successfully delivered. Parameters for pagination and limiting results are supported. ```php 0, 'limit' => 50 ); $delivered = $dasha->reports_delivered('54321', $params); print_r($delivered); ``` -------------------------------- ### Get Unsubscribed List Source: https://context7.com/dashamail/php_dashamail/llms.txt Returns a list of subscribers who have unsubscribed after receiving a campaign. Requires the campaign ID. ```php reports_unsubscribed('54321'); print_r($unsubscribed); ``` -------------------------------- ### Get Bounced Emails List Source: https://context7.com/dashamail/php_dashamail/llms.txt Fetches a list of emails that could not be delivered (bounced). Requires the campaign ID. ```php reports_bounced('54321'); print_r($bounced); ``` -------------------------------- ### Get Client Statistics Source: https://context7.com/dashamail/php_dashamail/llms.txt Provides statistics on the email clients, operating systems, and browsers used by recipients. Useful for understanding user environments. ```php reports_clients('54321'); print_r($clientStats); // Результат: распределение открытий по почтовым клиентам и устройствам ``` -------------------------------- ### Get Opened Emails List Source: https://context7.com/dashamail/php_dashamail/llms.txt Retrieves a list of emails that have been opened by recipients. Supports pagination and limiting results. ```php 0, 'limit' => 50 ); $opened = $dasha->reports_opened('54321', $params); print_r($opened); ``` -------------------------------- ### Get Click Statistics Source: https://context7.com/dashamail/php_dashamail/llms.txt Provides statistics on link clicks within an email campaign. Returns an array of URLs and their corresponding click counts. ```php reports_clickstat('54321'); print_r($clickStats); // Результат: массив с URL и количеством кликов по каждой ссылке ``` -------------------------------- ### Get Sent Emails List Source: https://context7.com/dashamail/php_dashamail/llms.txt Retrieves a list of all emails sent within a campaign. Supports pagination, limiting results, and ordering. ```php 0, 'limit' => 100, 'order' => 'desc' ); $sentEmails = $dasha->reports_sent('54321', $params); print_r($sentEmails); ``` -------------------------------- ### Get Bounce Statistics Source: https://context7.com/dashamail/php_dashamail/llms.txt Returns detailed statistics on the reasons for email delivery failures (bounces). Provides a breakdown by bounce type (e.g., hard, soft). ```php reports_bouncestat('54321'); print_r($bounceStats); // Результат: статистика по типам bounce (hard, soft и т.д.) ``` -------------------------------- ### Get Specific HTML Template Source: https://context7.com/dashamail/php_dashamail/llms.txt Retrieves a specific HTML template by its ID. An array containing the template ID must be passed as a parameter. ```php // Получить конкретный шаблон $params = array('id' => '100'); $template = $dasha->campaigns_get_templates($params); print_r($template); ``` -------------------------------- ### Get Geo Statistics Source: https://context7.com/dashamail/php_dashamail/llms.txt Returns geographical statistics on email opens, broken down by region and country. Helps in understanding the geographic distribution of recipients. ```php reports_geo('54321'); print_r($geoStats); // Результат: распределение открытий по географическим регионам ``` -------------------------------- ### Initialize PHPDasha and Validate Email Source: https://context7.com/dashamail/php_dashamail/llms.txt Create a new instance of the PHPDasha class using your credentials and perform email validation. ```php checkEmail('test@example.com'); if ($validEmail !== false) { echo "Проверенный email: " . $validEmail; } else { echo "Email некорректен"; } ``` -------------------------------- ### Create Campaigns Source: https://context7.com/dashamail/php_dashamail/llms.txt Methods for creating standard email campaigns or automated trigger-based campaigns. ```php 'Новогодняя распродажа', 'subject' => 'Скидки до 50% на всё!', 'from_name' => 'Интернет-магазин', 'from_email' => 'news@myshop.ru', 'html' => 'Наши акции...
Отписаться', 'plain_text' => 'Привет! Наши акции... Отписаться: [unsubscribe]' ); $result = $dasha->campaigns_create($list_ids, $params); print_r($result); // Результат содержит campaign_id созданной рассылки ``` ```php array('12345'), 'name' => 'Приветственное письмо', 'subject' => 'Добро пожаловать!', 'from_name' => 'Компания', 'from_email' => 'welcome@company.ru', 'html' => '{{content}}
Отписаться