コード例 #1
0
ファイル: EmailController.php プロジェクト: seblemeur/Naodev
 public function postForm(EmailRequest $request, Email $email)
 {
     $email->email = $request->input('email');
     $email->libelle = $request->input('libelle');
     $email->save();
     return view('email_ok');
 }
コード例 #2
0
 /**
  * Store Emails for updates in the future
  *
  * @return Response
  */
 public function store(request $request)
 {
     $email = new Email();
     $email->email = $request->input('email');
     $email->save();
     return redirect()->back();
 }
コード例 #3
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     // error_log("------------------------------------------------------");
     $Mailer = new Email();
     $Mailer->email = $request['email'];
     /* $validator class with method fails() */
     $validator = Validator::make($request->all(), ['email' => 'required|email']);
     /* $isNewEmail =
                true: no email found in db
                false: duplicate email found in db
        */
     $isNewEmail = collect($Mailer->where('email', $Mailer->email)->get())->isEmpty() ? true : false;
     if ($validator->fails()) {
         error_log(json_encode(['error' => ['invalid_email' => $request->all()]]));
         return response()->json(['error' => 'E-mail is invalid'])->setCallback($request->input('callback'));
     } elseif (!$isNewEmail) {
         error_log(json_encode(['error' => ['duplicate_email' => $request->all()]]));
         return response()->json(['error' => 'E-mail is marked as being subscribed'])->setCallback($request->input('callback'));
         return redirect('/')->withErrors($validator)->withInput();
     } else {
         error_log(json_encode(['mailer' => ['newEmail' => $Mailer]]));
         // soon
         $Scribe = $this->subscribe($Mailer->email);
         // soon
         error_log(json_encode(['scribe' => $Scribe]));
         $Mailer->save();
         return response()->json(['success' => true])->setCallback($request->input('callback'));
     }
 }
コード例 #4
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     $mail = new SendMailController();
     $cam = $this->campaign;
     //        $list_ids = $cam->subscribers_lists()->select('id')->get()->pluck('id')->toArray();
     $str = implode(',', $this->list_ids);
     $query = "select distinct email from subscribers where id in " . "(select subscriber_id from subscriber_subscribers_list where subscribers_list_id in ({$str})) limit " . $this->take . " offset " . $this->skip;
     $subscribers = DB::select($query);
     //        $subscribers = $l->subscribers()->take($this->take)->skip($this->skip)->get();
     foreach ($subscribers as $subscriber) {
         if (filter_var($subscriber->email, FILTER_VALIDATE_EMAIL)) {
             $url = 'http://colorme.vn/manage/email/open?cam_id=' . $cam->id . '&to=' . $subscriber->email;
             $content = $cam->template->content . '<img src="' . $url . '" width="1" height="1"/>';
             $result = $mail->sendAllEmail([$subscriber->email], $cam->subject, $content);
             $email_id = $result->get('MessageId');
             $email = Email::find($email_id);
             if ($email == null) {
                 $email = new Email();
                 $email->id = $email_id;
                 $email->status = 0;
             }
             $email->campaign_id = $cam->id;
             $email->to = $subscriber->email;
             $email->save();
         }
     }
 }
コード例 #5
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(EmailRequest $request, $id)
 {
     $email = Email::findOrFail($id);
     $email->fill($request->all());
     $email->save();
     return Redirect::back()->with("good", "Successfully updated email template.");
 }
コード例 #6
0
ファイル: ContactoController.php プロジェクト: uemCvs/CV
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     $cont = Contacto::find($id);
     $telefones = Telefone::where('contacto_id', '=', $id)->get();
     $emails = Email::where('contacto_id', '=', $id)->get();
     return view("contacto", ['cont' => $cont]);
 }
コード例 #7
0
 /**
  * Sends emails
  *
  * @return Response
  */
 public function send()
 {
     $emails = Email::notSent()->get();
     foreach ($emails as $email) {
         $email->send();
     }
 }
コード例 #8
0
 public function run()
 {
     $contacts = Contact::all();
     $campaign = Campaign::where('name', '=', 'Halloween Video')->first();
     foreach ($contacts as $contact) {
         Email::create(['send_on' => Carbon::now()->addMinutes(5), 'template' => 'emails.halloween', 'subject' => 'Happy Halloween!', 'draft' => false, 'campaign_id' => $campaign->id, 'contact_id' => $contact->id]);
     }
 }
コード例 #9
0
ファイル: EmailHelper.php プロジェクト: ripixel/polefitness
 public static function sendEmail($id, $tags, $to)
 {
     $template = Email::findOrFail($id);
     $subject = EmailHelper::replaceTags($template->subject, $tags);
     $content = EmailHelper::replaceTags($template->content, $tags);
     Mail::send('emails.echo', ['html' => $content], function ($m) use($to, $subject) {
         $m->to($to)->subject($subject)->from('*****@*****.**', 'UoS Pole Fitness Society');
     });
 }
コード例 #10
0
 public function signUp(Request $request)
 {
     $validator = Validator::make($request->all(), ['email' => 'required|different:password|email|unique:users,email', 'password' => 'required|min:12']);
     if ($validator->fails()) {
         return redirect('/signup')->withErrors($validator)->withInput();
     }
     $user = new User();
     $user->email = $request->get('email');
     $user->password = bcrypt($request->get('password'));
     $user->save();
     $email = new Email();
     $email->user_id = $user->id;
     $email->email = $user->email;
     $email->verified = false;
     $email->save();
     $this->dispatch(new SendVerificationEmail($email));
     return redirect('/')->with('message', 'Successfully registered. Please check your email for a verification link.');
 }
コード例 #11
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $emails = Email::published()->unsent()->ready()->get();
     foreach ($emails as $email) {
         $email->send();
         $this->info("Sent email to " . $email->contact->email);
     }
     $this->info('Done Sending Emails');
 }
コード例 #12
0
ファイル: MailTest.php プロジェクト: distilleries/mailersaver
 public function setUp()
 {
     parent::setUp();
     $this->app->singleton('Distilleries\\MailerSaver\\Contracts\\MailModelContract', function ($app) {
         return new \App\Email();
     });
     $this->app['Illuminate\\Contracts\\Console\\Kernel']->call('migrate', ['--database' => 'testbench', '--realpath' => realpath(__DIR__ . '/../src/database/migrations')]);
     \App\Email::create(['action' => 'test', 'libelle' => 'test', 'body_type' => 'html', 'cc' => 'testcc@test', 'bcc' => 'testbcc@test', 'content' => 'test', 'status' => 0]);
 }
コード例 #13
0
 public function overview()
 {
     $data['inbox_count'] = Email::where('user_id', Auth::id())->where('box_id', 1)->count();
     //todo: if you want to write articles, contact us
     $articles = Article::where('user_id', Auth::id())->orderBy('id', 'asc')->get();
     $sites = Auth::user()->sites()->get();
     $professions = Auth::user()->professions()->get();
     $classifieds = Classified::where('user_id', Auth::id())->orderBy('id', 'desc')->get();
     return view('dashboard.overview', compact('data', 'articles', 'sites', 'professions', 'classifieds'));
 }
コード例 #14
0
 public function send(EmailRequest $request)
 {
     // Collect info from forms
     $name = $request->input('name');
     $from_email = $request->input('email');
     $message_text = $request->input('message');
     $emails = Email::lists('email')->toArray();
     Mail::send('emails.contact-us', ['name' => $name, 'message_text' => $message_text], function ($message) use($name, $from_email, $emails) {
         $message->from($from_email, $name);
         $message->to($emails)->subject('MyFollowUp - Contact Us');
     });
     return redirect('/');
 }
コード例 #15
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     die;
     $paises = Pais::all();
     $provincias = Provincia::all();
     $departamentos = Departamento::all();
     $localidades = Localidad::all();
     $calles = Calle::all();
     $domicilios = Domicilio::all();
     $telefonos = Telefono::all();
     $emails = Email::all();
     $webs = Web::all();
 }
コード例 #16
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     /*
     $resultsa = User::with('Email')
         ->whereHas('Email', function($q)
         {
             $q->where('user_id',Auth::user()->id);
     
         })->get();
     dd($resultsa);
     */
     $results = Email::where('user_id', Auth::user()->id)->get();
     return view('app.email.index', compact('results'));
 }
コード例 #17
0
ファイル: GetIdentity.php プロジェクト: codeforpg/PostIt
 public function getModel()
 {
     if (\Auth::check()) {
         return \Auth::user();
     }
     if ($this->request->hasCookie('email_user')) {
         $user = Email::where('email', $this->request->cookie('email_user'));
     }
     if ($this->request->hasCookie('guest_user')) {
         $tracker = $this->request->cookie('guest_user');
     }
     $tracker = $this->request->getClientIp();
     $user = Guest::firstOrCreate(['identifier' => $tracker]);
     return $user;
 }
コード例 #18
0
ファイル: SetupController.php プロジェクト: verchielxy/eform
 public function getIndex(Request $request)
 {
     User::createTable();
     // User::createAdmin('*****@*****.**','admin');
     Img::createTable();
     Mylog::createTable();
     Email::createTable();
     Banner::createTable();
     Activity::createTable();
     Form::createTable();
     Field::createTable();
     FieldChildren::createTable();
     Result::createTable();
     ResultRow::createTable();
     Charge::createTable();
 }
コード例 #19
0
ファイル: UserController.php プロジェクト: verchielxy/eform
 public function postFSave(FSavePRequest $request, $user_email, $form_url)
 {
     $user = User::where('user_email', base64_decode($user_email))->where('user_active', '1')->firstOrFail();
     $form = $user->Form()->where('form_url', $form_url)->where('form_active', 1)->firstOrFail();
     if (!$form->canWrite()) {
         return redirect()->back()->with('msgError', '表单已经超过填写人数的最大限制了');
     }
     $agent = new Agent();
     $platform = $agent->platform();
     $platform_v = $agent->version($platform);
     $browser = $agent->browser();
     $browser_v = $agent->version($browser);
     $device = $agent->device();
     $result = Result::create(['result_ruid' => Auth::check() ? Auth::id() : 0, 'result_form_id' => $form->form_id, 'result_ip' => ip2long($request->ip()), 'result_device' => $device, 'result_system' => $platform, 'result_system_v' => $platform_v, 'result_browser' => $browser, 'result_browser_v' => $browser_v]);
     if ($result) {
         //插入数据
         $fields = $form->Field()->orderBy('field_sort', 'ASC')->get();
         $splitStr = ':$split$:';
         $user_id = Auth::check() ? Auth::id() : 0;
         foreach ($fields as $field) {
             $inputs = $request->input($field->field_attr_name);
             if (is_array($inputs)) {
                 if ($field->field_type == 'group:shop-thumbnail') {
                     $rows = [];
                     foreach ($inputs as $input) {
                         $rows[] = $input['goods_name'] . '(' . $input['goods_preice'] . '):' . $input['goods_num'];
                     }
                     $resultrow_attr_value = implode($splitStr, $rows);
                 } else {
                     $resultrow_attr_value = implode($splitStr, $inputs);
                 }
             } else {
                 $resultrow_attr_value = $inputs;
             }
             ResultRow::create(['resultrow_ruid' => $user_id, 'resultrow_result_id' => $result->result_id, 'resultrow_sort' => $field->field_sort, 'resultrow_type' => $field->field_type, 'resultrow_title' => $field->field_title, 'resultrow_tips' => $field->field_tips, 'resultrow_attr_name' => $field->field_attr_name, 'resultrow_attr_value' => $resultrow_attr_value]);
         }
         // 发送邮件提示
         if ($form->form_tips_email) {
             $email = Email::create(['email_cuid' => 0, 'email_ruid' => $user->user_id, 'email_block' => 'form_reply_tips', 'email_target' => $user->user_email, 'email_title' => '[ ' . WEBSITE_NAME . ' ]提示您:您的表单有了新的回复', 'email_datas' => $form->form_code, 'email_is_sent' => 0]);
             $this->dispatch(new SendReminderEmail($email));
         }
         $res = redirect('/u/' . $user_email . '/f-success')->with('msgSuccess', '您的表单已经成功提交,感谢您的参与。');
     } else {
         $res = redirect()->back()->with('msgError', MSG_FA);
     }
     return $res;
 }
コード例 #20
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     // People route-model binding
     $router->bind('peoples', function ($id) {
         return \App\People::findOrFail($id);
     });
     // Project route-model binding
     $router->bind('projects', function ($id) {
         return \App\Project::findOrFail($id);
     });
     // Publication route-model binding
     $router->bind('publications', function ($id) {
         return \App\Publication::findOrFail($id);
     });
     // Email route-model binding
     $router->bind('emails', function ($id) {
         return \App\Email::findOrFail($id);
     });
 }
コード例 #21
0
 /**
  * Store a newly created people in storage.
  *
  * @param CreateEmailRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function store(CreateEmailRequest $request)
 {
     Email::create($request->all());
     return redirect()->action('PagesController@manageEmails');
 }
コード例 #22
0
 public function makePrimary($id)
 {
     /**
      * @var $email Email
      */
     $email = Email::find($id);
     if (is_null($email)) {
         return redirect('/')->withErrors(['Invalid email.']);
     }
     Auth::user()->email = $email->email;
     Auth::user()->save();
     return redirect('/');
 }
コード例 #23
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function editUser($slug)
 {
     //
     $user = User::where('slug', '=', $slug)->first();
     $number = Number::where('user_id', '=', $user->id)->get();
     $mail = Email::where('user_id', '=', $user->id)->get();
     $option[0] = $user;
     $option[1] = $number;
     $option[2] = $mail;
     //dd($option);
     return view('frontend.edit', compact('option'));
 }
 private function addContactsToCampaign($campaign)
 {
     $contacts = Email::where('campaign_id', '=', $campaign->id)->lists('contact_id')->toArray();
     $campaign->contacts()->sync($contacts);
 }
コード例 #25
0
ファイル: AuthController.php プロジェクト: verchielxy/eform
 public function postForgetPassword(ForgetPasswordPRequest $request)
 {
     $user = User::where('user_email', '=', $request->input('login_name'))->firstOrFail();
     $email = Email::create(['email_cuid' => 0, 'email_ruid' => $user->user_id, 'email_block' => 'user_password_reset', 'email_target' => $user->user_email, 'email_title' => '[ ' . WEBSITE_NAME . ' ]找回密码,请您按照提示操作', 'email_datas' => str_random(15), 'email_is_sent' => 0]);
     $this->dispatch(new SendReminderEmail($email));
     $res = redirect('/login')->with('msgSuccess', '密码重置邮件已发送,请查收');
     return $res;
 }
コード例 #26
0
ファイル: SettingsController.php プロジェクト: sislex/cat
 public function deleteEmail($id)
 {
     Email::destroy($id);
     return \Redirect::action('Admin\\SettingsController@email');
 }
コード例 #27
0
 public function manageEmails()
 {
     $emails = Email::all();
     return view('admin.pages.emails', ['emails' => $emails]);
 }
コード例 #28
0
require "fs_folders/php_functions/function.php";
require "fs_folders/php_functions/library.php";
require "fs_folders/php_functions/source.php";
require "fs_folders/php_functions/myclass.php";
require "fs_folders/dropdown/dropdown_php_file/dropdown.php";
$dd = new dropdown();
$mc = new myclass();
$ri = new resizeImage();
$mc->auto_detect_path();
$mno = $mc->get_cookie('mno', 136);
$_SESSION["mno"] = $mc->get_cookie('mno', 136);
require 'fs_folders/php_functions/Class/User.php';
require 'fs_folders/php_functions/Class/Email.php';
use App\Email;
$user = new User($mno, $db);
$email = new Email($mno, $db);
//print_r($user->getInfo());
if ($user->getInfo()[0]['status'] == 0) {
    $email->sendConfirmationEmail($user->getInfo()[0]['identity_email'], $mc->mno);
    print 'New confirmation email sent to ' . $user->getInfo()[0]['identity_email'];
} else {
    print 'User already confirmed.';
}
?>



<a href="home">Back</a> to home page.


コード例 #29
0
 public function destroy($id)
 {
     $email = Email::find($id);
     $contact = $email->contact;
     $email->delete();
     return redirect()->back()->with('warning', "email to {$contact->email} deleted");
 }
コード例 #30
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy()
 {
     Email::where('email', '=', Request::get('email'))->delete();
     return redirect('/')->with('update', 'Sorry to see you go!');
 }