Project

General

Profile

« Previous | Next » 

Revision 638

Added by thorn almost 17 years ago

Allow a user-supplied From-Name in form-settings for email und success-email.

View differences:

view.php
340 340
				// Set the email from field to what the user entered in the specified field
341 341
				$email_from = $wb->add_slashes($_POST[$email_from]);
342 342
			}
343
			$email_fromname = $fetch_settings['email_fromname'];
343 344
			$email_subject = $fetch_settings['email_subject'];
344 345
			$success_page = $fetch_settings['success_page'];
345 346
			$success_email_to = $fetch_settings['success_email_to'];
......
348 349
				$success_email_to = $wb->add_slashes($_POST[$success_email_to]);
349 350
			}
350 351
			$success_email_from = $fetch_settings['success_email_from'];
352
			$success_email_fromname = $fetch_settings['success_email_fromname'];
351 353
			$success_email_text = $fetch_settings['success_email_text'];
352 354
			$success_email_subject = $fetch_settings['success_email_subject'];		
353 355
			$max_submissions = $fetch_settings['max_submissions'];
......
445 447
					// Now send the email
446 448
					if($email_to != '') {
447 449
						if($email_from != '') {
448
							if($wb->mail($email_from,$email_to,$email_subject,$email_body)) {
450
							if($wb->mail($email_from,$email_to,$email_subject,$email_body,$email_fromname)) {
449 451
								$success = true;
450 452
							}
451 453
						} else {
452
							if($wb->mail('',$email_to,$email_subject,$email_body)) { 
454
							if($wb->mail('',$email_to,$email_subject,$email_body,$email_fromname)) { 
453 455
								$success = true; 
454 456
							}
455 457
						}
456 458
					}				
457 459
					if($success_email_to != '') {
458 460
						if($success_email_from != '') {
459
							if($wb->mail($success_email_from,$success_email_to,$success_email_subject,$success_email_text)) {
461
							if($wb->mail($success_email_from,$success_email_to,$success_email_subject,$success_email_text,$success_email_fromname)) {
460 462
								$success = true;
461 463
							}
462 464
						} else {
463
							if($wb->mail('',$success_email_to,$success_email_subject,$success_email_text)) {
465
							if($wb->mail('',$success_email_to,$success_email_subject,$success_email_text,$success_email_fromname)) {
464 466
								$success = true;
465 467
							}
466 468
						}

Also available in: Unified diff