Skip to content

Commit

Permalink
Merge pull request mautic#49 from kerleba/cannot-send-email
Browse files Browse the repository at this point in the history
Fixed endpoint for sending email
  • Loading branch information
alanhartless authored Aug 25, 2016
2 parents b0e8fc8 + 1026e2a commit d710396
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/Api/Emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,31 @@ public function send($id)
return $this->makeRequest($this->endpoint.'/'.$id.'/send', array(), 'POST');
}

/**
* Send email to a specific contact
*
* @param int $id
* @param int $contactId
*
* @return array|mixed
*/
public function sendToContact($id, $contactId)
{
return $this->makeRequest($this->endpoint.'/'.$id.'/send/contact/'.$contactId, array(), 'POST');
}

/**
* Send email to a specific lead
*
* @deprecated use sendToContact instead
*
* @param int $id
* @param int $leadId
*
* @return array|mixed
*/
public function sendToLead($id, $leadId)
{
return $this->makeRequest($this->endpoint.'/'.$id.'/send/lead/'.$leadId, array(), 'POST');
return $this->sendToContact($id, $leadId);
}
}

0 comments on commit d710396

Please sign in to comment.