Happyr / TranslationBundle

[DEPRECATED] A bundle to integrate with third party translation platforms
MIT License
50 stars 22 forks source link

InvalidArgumentException in Client.php line 402: #44

Closed Raghava525 closed 8 years ago

Raghava525 commented 8 years ago

Hi, Am using laravel 5. The composer values are

"laravel/framework": "5.0.*", "guzzlehttp/guzzle": "^6.2",

When I am trying to send the mail using swift mailer : My code is:

$em_arr = Array(); $em_arr['to'] = $email; $em_arr['name'] = $name; $em_arr['subject'] = 'Forgot password'; $emailcontent = array('html'=> '');

$merg_vars = array(); $merg_vars['get_loan_offer'] = $get_loan_offer; $merg_vars['reset_password_link'] = $reset_password_link; $template_name = 'reset_password';

Mail::send('emails.emailsent', [], function($message) use ($em_arr, $merg_vars, $template_name) { $headers = $message->getHeaders(); $headers->addTextHeader('X-MC-Template', $template_name); $headers->addTextHeader('X-MC-MergeVars', json_encode($merg_vars)); $message->to($em_arr['to'], $em_arr['name'])->subject($em_arr['subject']); });

The issue I got : InvalidArgumentException in Client.php line 402: Passing in the "body" request option as an array to send a POST request has been deprecated. Please use the "form_params" request option to send a application/x-www-form-urlencoded request, or a the "multipart" request option to send a multipart/form-data request.

Can you please what's went wrong in my code. Can you please provide solution to send an email.

Nyholm commented 8 years ago

Hey. Thank your for reporting this issue. But are you sure this is the correct repo?

This bundle has nothing to do with Laravel nor sending emails.

On 26 Aug 2016, at 08:28, Raghava525 notifications@github.com wrote:

Hi, Am using laravel 5. The composer values are

"laravel/framework": "5.0.*", "guzzlehttp/guzzle": "^6.2",

When I am trying to send the mail using swift mailer : My code is:

$em_arr = Array(); $em_arr['to'] = $email; $em_arr['name'] = $name; $em_arr['subject'] = 'Forgot password'; $emailcontent = array('html'=> '');

$merg_vars = array(); $merg_vars['get_loan_offer'] = $get_loan_offer; $merg_vars['reset_password_link'] = $reset_password_link; $template_name = 'reset_password';

Mail::send('emails.emailsent', [], function($message) use ($em_arr, $merg_vars, $template_name) { $headers = $message->getHeaders(); $headers->addTextHeader('X-MC-Template', $template_name); $headers->addTextHeader('X-MC-MergeVars', json_encode($merg_vars)); $message->to($em_arr['to'], $em_arr['name'])->subject($em_arr['subject']); });

The issue I got : InvalidArgumentException in Client.php line 402: Passing in the "body" request option as an array to send a POST request has been deprecated. Please use the "form_params" request option to send a application/x-www-form-urlencoded request, or a the "multipart" request option to send a multipart/form-data request.

Can you please what's went wrong in my code. Can you please provide solution to send an email.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

tobias-nitsche commented 8 years ago

Yes it's wrong repo.

Pretty sure Upgrading your Laravel Version or Downgrading Guzzle might help. Solution 1 might be practical.

https://github.com/laravel/framework/commit/599c4e15afa1c0ff9e1a783afcc4c239418a9c8c

See here, Laravel 5.3 uses form_params.

But its Off-Topic, wrong repo.

Raghava525 commented 8 years ago

Sorry . Its wrong rep to ask this question here. And thank you so much . It will be helpful answer from you.