1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

testing email functionality:

This commit is contained in:
David Bomba 2016-01-29 12:47:35 +11:00
parent 32acb8b86a
commit 020e428677
3 changed files with 22 additions and 0 deletions

View File

@ -249,6 +249,26 @@ class InvoiceApiController extends BaseAPIController
return $item;
}
public function emailInvoicev2()
{
$data = Input::all();
$error = null;
$invoice = Invoice::scope($data['id'])->firstOrFail();
$this->mailer->sendInvoice($invoice);
if($error) {
$response['error'] = "There was an error sending the invoice";
}
else {
$response = json_encode(RESULT_SUCCESS, JSON_PRETTY_PRINT);
}
$headers = Utils::getApiHeaders();
return Response::make($response, $error ? 400 : 200, $headers);
}
public function emailInvoice()
{
$data = Input::all();

View File

@ -7,6 +7,7 @@ class VerifyCsrfToken extends BaseVerifier {
private $openRoutes = [
'signup/register',
'api/v1/*',
'api/v1/login',
'api/v1/clients/*',
'api/v1/clients',

View File

@ -230,6 +230,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function()
Route::resource('tasks', 'TaskApiController');
Route::post('hooks', 'IntegrationController@subscribe');
Route::post('email_invoice', 'InvoiceApiController@emailInvoice');
Route::post('email_invoicev2', 'InvoiceApiController@emailInvoicev2');
Route::get('user_accounts','AccountApiController@getUserAccounts');
// Vendor