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:
parent
32acb8b86a
commit
020e428677
@ -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();
|
||||
|
@ -7,6 +7,7 @@ class VerifyCsrfToken extends BaseVerifier {
|
||||
|
||||
private $openRoutes = [
|
||||
'signup/register',
|
||||
'api/v1/*',
|
||||
'api/v1/login',
|
||||
'api/v1/clients/*',
|
||||
'api/v1/clients',
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user