tests working with emails alsog

This commit is contained in:
2025-11-10 23:51:18 -08:00
parent a659368867
commit f26aa9cbd3
11 changed files with 240 additions and 24 deletions

View File

@@ -6,20 +6,21 @@ use Cake\Core\Configure;
* @var \CakeContactUs\Model\Entity\ContactUsFormSubmission $contactUsFormSubmission
*/
?>
<p>
<?= __d('cake_contact_us', "A contact us form submission was received at {0}", $contactUsFormSubmission->submitted_at) ?>,
</p>
<p>
<?= h($contactUsFormSubmission->name); ?>
</p>
<?php if (Configure::readOrFail('ContactUs.fields.email') || isset($contactUsFormSubmission->email)) : ?>
<?php if (Configure::read('ContactUs.fields.email', false) && isset($contactUsFormSubmission->email)) : ?>
<p>
<strong><?= __d('cake_contact_us', 'Email: ') ?></strong>
<?= $this->Html->link($contactUsFormSubmission->email, 'mailto:' . $contactUsFormSubmission->email); ?>
</p>
<?php endif; ?>
<?php if (Configure::readOrFail('ContactUs.fields.subject') || isset($contactUsFormSubmission->subject)) : ?>
<?php if (Configure::read('ContactUs.fields.subject', false) && isset($contactUsFormSubmission->subject)) : ?>
<p>
<strong><?= __d('cake_contact_us', 'Subject: ') ?></strong>
<span><?= h($contactUsFormSubmission->subject); ?></span>
@@ -28,5 +29,4 @@ use Cake\Core\Configure;
<p>
<strong><?= __d('cake_contact_us', 'Message: ') ?></strong>
<?= h($contactUsFormSubmission->message); ?>
</p>
</p>

View File

@@ -6,4 +6,4 @@
</p>
<p>
<?= __d('cake_contact_us', 'Thank you') ?>,
</p>
</p>

View File

@@ -5,21 +5,22 @@ use Cake\Core\Configure;
/**
* @var \CakeContactUs\Model\Entity\ContactUsFormSubmission $contactUsFormSubmission
*/
?>
<?= __d('cake_contact_us', "A contact us form submission was received at {0}", $contactUsFormSubmission->submitted_at) ?>,
<?= __d('cake_contact_us', 'Name: ') ?><?= h($contactUsFormSubmission->name); ?>
<?php if (Configure::readOrFail('ContactUs.fields.email') || isset($contactUsFormSubmission->email)) : ?>
<?php if (Configure::read('ContactUs.fields.email', false) && isset($contactUsFormSubmission->email)) : ?>
<?= __d('cake_contact_us', 'Email: ') ?>
<?= $contactUsFormSubmission->email; ?>
<?php endif; ?>
<?php if (Configure::readOrFail('ContactUs.fields.subject') || isset($contactUsFormSubmission->subject)) : ?>
<?php if (Configure::read('ContactUs.fields.subject', false) && isset($contactUsFormSubmission->subject)) : ?>
<?= __d('cake_contact_us', 'Subject: ') ?>
<?= h($contactUsFormSubmission->subject); ?>
<?php endif; ?>
<?= __d('cake_contact_us', 'Message: ') ?>
<?= h($contactUsFormSubmission->message); ?>
<?= h($contactUsFormSubmission->message); ?>

View File

@@ -9,9 +9,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<?= __d('cake_contact_us', "Hi {0}", isset($first_name) ? $first_name : '') ?>,
<?= __d('cake_contact_us', "Hi {0}", isset($contactUsFormSubmission->name) ? $contactUsFormSubmission->name : '') ?>,
<?= __d('cake_contact_us','We have received your message. We will be in touch soon.') ?>
<?= __d('cake_contact_us', 'Thank you') ?>,

View File

@@ -0,0 +1,25 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
* @var \App\View\AppView $this
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title><?= $this->fetch('title') ?></title>
</head>
<body>
<?= $this->fetch('content') ?>
</body>
</html>

View File

@@ -0,0 +1,17 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
* @var \App\View\AppView $this
*/
echo $this->fetch('content');