|  | @@ -24,14 +24,18 @@ class SeminarSignUpController extends ApiController
 | 
	
		
			
			| 24 | 24 |      {
 | 
	
		
			
			| 25 | 25 |          $trackNo = $request->input('trackNo', '');
 | 
	
		
			
			| 26 | 26 |          $lang = substr($trackNo, 0, 2);
 | 
	
		
			
			|  | 27 | +
 | 
	
		
			
			| 27 | 28 |          $firstName_orig = $request->input('firstName', '');
 | 
	
		
			
			| 28 | 29 |          $firstName = $this->safeEncrypt($firstName_orig, 'arm');
 | 
	
		
			
			| 29 | 30 |  
 | 
	
		
			
			| 30 |  | -        $lastName = $this->safeEncrypt($request->input('lastName', ''), 'arm');
 | 
	
		
			
			| 31 |  | -        $companyName = $this->safeEncrypt($request->input('companyName', ''), 'arm');
 | 
	
		
			
			| 32 |  | -
 | 
	
		
			
			|  | 31 | +        $lastName_orig = $request->input('lastName', '');
 | 
	
		
			
			|  | 32 | +        $lastName = $this->safeEncrypt($request->input('lastName_orig', ''), 'arm');
 | 
	
		
			
			|  | 33 | +        
 | 
	
		
			
			|  | 34 | +        $companyName_orig = $request->input('companyName', '');
 | 
	
		
			
			|  | 35 | +        $companyName = $this->safeEncrypt($request->input('companyName_orig', ''), 'arm');
 | 
	
		
			
			|  | 36 | +        
 | 
	
		
			
			| 33 | 37 |          $companyEmail_orig = $request->input('companyEmail', '');
 | 
	
		
			
			| 34 |  | -        $companyEmail = $this->safeEncrypt($companyEmail_orig, 'arm');
 | 
	
		
			
			|  | 38 | +        $companyEmail = $this->safeEncrypt($request->input('companyEmail_orig', ''), 'arm');
 | 
	
		
			
			| 35 | 39 |          
 | 
	
		
			
			| 36 | 40 |          $backupEmail = $request->input('backupEmail', '');
 | 
	
		
			
			| 37 | 41 |          if (!is_null($backupEmail)) {
 | 
	
	
		
			
			|  | @@ -41,8 +45,10 @@ class SeminarSignUpController extends ApiController
 | 
	
		
			
			| 41 | 45 |          } else {
 | 
	
		
			
			| 42 | 46 |              $backupEmail_orig = '';
 | 
	
		
			
			| 43 | 47 |          }
 | 
	
		
			
			| 44 |  | -
 | 
	
		
			
			| 45 |  | -        $phoneNumber = $this->safeEncrypt($request->input('phoneNumber', ''), 'arm');
 | 
	
		
			
			|  | 48 | +        
 | 
	
		
			
			|  | 49 | +        $phoneNumber_orig = $request->input('phoneNumber', '');
 | 
	
		
			
			|  | 50 | +        $phoneNumber = $this->safeEncrypt($request->input('phoneNumber_orig', ''), 'arm');
 | 
	
		
			
			|  | 51 | +        
 | 
	
		
			
			| 46 | 52 |          $country = $request->input('country', '');
 | 
	
		
			
			| 47 | 53 |          $registeredSession = $request->input('registeredSession', '');
 | 
	
		
			
			| 48 | 54 |          $lunchOptions = $request->input('lunchOptions', '');
 | 
	
	
		
			
			|  | @@ -82,7 +88,8 @@ class SeminarSignUpController extends ApiController
 | 
	
		
			
			| 82 | 88 |              $res = '報名成功';
 | 
	
		
			
			| 83 | 89 |  
 | 
	
		
			
			| 84 | 90 |              if ($lang=='TP'||$lang=='HS') {
 | 
	
		
			
			| 85 |  | -                $this->mailToUser_TW($firstName_orig, $companyEmail_orig, $backupEmail_orig);
 | 
	
		
			
			|  | 91 | +                $this->mailToUser_TW($firstName_orig, $lastName_orig, $companyName_orig, $companyEmail_orig, $backupEmail_orig, 
 | 
	
		
			
			|  | 92 | +                    $phoneNumber_orig, $country, $registeredSession, $lunchOptions, $typeOfIndustry, $typeOfJob, $jobTitle, $trackOfInterest);
 | 
	
		
			
			| 86 | 93 |              } elseif ($lang=='JP') {
 | 
	
		
			
			| 87 | 94 |                  $this->mailToUser_JP($firstName_orig, $companyEmail_orig, $backupEmail_orig);
 | 
	
		
			
			| 88 | 95 |              } elseif ($lang=='KR') {
 | 
	
	
		
			
			|  | @@ -169,12 +176,40 @@ class SeminarSignUpController extends ApiController
 | 
	
		
			
			| 169 | 176 |          return base64_decode(join('', $strArr));
 | 
	
		
			
			| 170 | 177 |      }
 | 
	
		
			
			| 171 | 178 |      
 | 
	
		
			
			| 172 |  | -    public function mailToUser_TW(string $firstName='', string $companyEmail='', string $backupEmail='')
 | 
	
		
			
			|  | 179 | +    public function mailToUser_TW(
 | 
	
		
			
			|  | 180 | +        string $firstName='', 
 | 
	
		
			
			|  | 181 | +        string $lastName='', 
 | 
	
		
			
			|  | 182 | +        string $companyName='',
 | 
	
		
			
			|  | 183 | +        string $companyEmail='',
 | 
	
		
			
			|  | 184 | +        string $backupEmail='',
 | 
	
		
			
			|  | 185 | +        string $phoneNumber='',
 | 
	
		
			
			|  | 186 | +        string $country='',
 | 
	
		
			
			|  | 187 | +        string $registeredSession='',
 | 
	
		
			
			|  | 188 | +        string $lunchOptions='',
 | 
	
		
			
			|  | 189 | +        string $typeOfIndustry='',
 | 
	
		
			
			|  | 190 | +        string $typeOfJob='',
 | 
	
		
			
			|  | 191 | +        string $jobTitle='',
 | 
	
		
			
			|  | 192 | +        string $trackOfInterest=''
 | 
	
		
			
			|  | 193 | +        )
 | 
	
		
			
			| 173 | 194 |      {
 | 
	
		
			
			| 174 |  | -        $data = array('name'=>$firstName);
 | 
	
		
			
			|  | 195 | +        $data = array(
 | 
	
		
			
			|  | 196 | +            'firstName' => $firstName,
 | 
	
		
			
			|  | 197 | +            'lastName' => $lastName,
 | 
	
		
			
			|  | 198 | +            'companyName' => $companyName,
 | 
	
		
			
			|  | 199 | +            'companyEmail' => $companyEmail,
 | 
	
		
			
			|  | 200 | +            'backupEmail' => $backupEmail,
 | 
	
		
			
			|  | 201 | +            'phoneNumber' => $phoneNumber,
 | 
	
		
			
			|  | 202 | +            'country' => $country,
 | 
	
		
			
			|  | 203 | +            'registeredSession' => $registeredSession,
 | 
	
		
			
			|  | 204 | +            'lunchOptions' => $lunchOptions,
 | 
	
		
			
			|  | 205 | +            'typeOfIndustry' => $typeOfIndustry,
 | 
	
		
			
			|  | 206 | +            'typeOfJob' => $typeOfJob,
 | 
	
		
			
			|  | 207 | +            'jobTitle' => $jobTitle,
 | 
	
		
			
			|  | 208 | +            'trackOfInterest' => $trackOfInterest,
 | 
	
		
			
			|  | 209 | +        );
 | 
	
		
			
			| 175 | 210 |  
 | 
	
		
			
			| 176 |  | -        if ($backupEmail) {
 | 
	
		
			
			| 177 |  | -            \Mail::send(['text'=>'mailTW'], $data, function($message) use ($companyEmail, $firstName, $backupEmail) {
 | 
	
		
			
			|  | 211 | +        if (strlen($backupEmail)>0) {
 | 
	
		
			
			|  | 212 | +            \Mail::send(['text'=>'mailTW'], $data, function($message) use ($firstName, $companyEmail, $backupEmail) {
 | 
	
		
			
			| 178 | 213 |                  $message->to($companyEmail, $firstName)->subject('報名成功');
 | 
	
		
			
			| 179 | 214 |                  $message->cc($backupEmail, $firstName)->subject('報名成功');
 | 
	
		
			
			| 180 | 215 |                  $message->from(env('MAIL_USERNAME'),env('MAIL_FROM_NAME'));
 |