mautic / mautic/api-library

$emailApi->send - Send email to Segment

Open
#164 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Pending Feedback
Dominant language
PHP
Stars
205
Forks
129
PR merge metrics
No merged PRs in 30d

Description

As i see there's and issue with the REST API. The endpoint to send email to segments does not exist. 👎

Followed documentation to implement it as explained at: https://developer.mautic.org/#send-email-to-segment

Using api i can send email to a contact. But endpoint to send email to segment attached to email does not exist. Take a look at the dump from email API connection.... Endpoints called bcRegexEndpoints array size is (1) Mautic version is v2.13.1

object(Mautic\Api\Emails)#5866 (11) {

  ["endpoint":protected]=>
  string(6) "emails"

  ["listName":protected]=>
  string(6) "emails"

  ["itemName":protected]=>
  string(5) "email"

  ["bcRegexEndpoints":protected]=>
  **array(1) {
    ["emails/(.*?)/contact/(.*?)/send"]=>
    string(25) "emails/$1/send/contact/$2"
  }**

  ["searchCommands":protected]=>
  array(7) {
    [0]=>
    string(3) "ids"
    [1]=>
    string(12) "is:published"
    [2]=>
    string(14) "is:unpublished"
    [3]=>
    string(7) "is:mine"
    [4]=>
    string(16) "is:uncategorized"
    [5]=>
    string(8) "category"
    [6]=>
    string(4) "lang"
  }

  ["bcTesting"]=>
  bool(false)

  ["endpointsSupported":protected]=>
  array(0) {
  }

  ["bcAttempt":protected]=>
  bool(false)

  ["baseUrl":protected]=>
  string(44) "https://ads.experienciasdigitais.com.br/api/"

  ["auth":"Mautic\Api\Api":private]=>
  object(Mautic\Auth\BasicAuth)#5865 (6) {
    ["password":"Mautic\Auth\BasicAuth":private]=>
    string(12) "XXXXXXXXXX"
    ["userName":"Mautic\Auth\BasicAuth":private]=>
    string(4) "yyyyy"
    ["_debug":protected]=>
    bool(false)
    ["_httpResponseHeaders":protected]=>
    NULL
    ["_httpResponseInfo":protected]=>
    NULL
    ["_curlTimeout":protected]=>
    NULL
  }
  ["logger":"Mautic\Api\Api":private]=>
  NULL
}

When i call the endpoint the following error occurs:

array(2) {
  ["errors"]=>
  array(1) {
    [0]=>
    array(3) {
      ["code"]=>
      int(404)
      ["message"]=>
      string(19) "Item was not found."
      ["details"]=>
      array(0) {
      }
    }
  }
  ["error"]=>
  array(3) {
    ["message"]=>
    string(115) "Item was not found. (`error` is deprecated as of 2.6.0 and will be removed in 3.0. Use the `errors` array instead.)"
    ["code"]=>
    int(404)
    ["details"]=>
    array(0) {
    }
  }
}

Email id is fine does exists on Mautic. So. Any idea?

Attached below source code.

code


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Mautic\Api\Emails entry point shown in the report and compare its supported endpoint mapping with the documented send-email-to-segment route. Reproduce the request on Mautic v2.13.1 using an existing email and segment, then confirm the segment-send endpoint is recognized and no longer returns the 404 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.