FEATURE: add second email into contact form
This commit adds second email into contact form - this one may be different from email used for delivering messages.
This commit is contained in:
@@ -43,12 +43,13 @@ class ContactForm extends Handler
|
|||||||
public static function createNew(Content &$content, Request $request)
|
public static function createNew(Content &$content, Request $request)
|
||||||
{
|
{
|
||||||
$settings = [
|
$settings = [
|
||||||
'phone' => $request->phone,
|
'phone' => $request->phone,
|
||||||
'email' => $request->email,
|
'email' => $request->email,
|
||||||
'companyName' => $request->companyName,
|
'contactEmail' => $request->ContactEmail,
|
||||||
'address' => $request->address,
|
'companyName' => $request->companyName,
|
||||||
'gpsLat' => $request->gpsLat,
|
'address' => $request->address,
|
||||||
'gpsLng' => $request->gpsLng,
|
'gpsLat' => $request->gpsLat,
|
||||||
|
'gpsLng' => $request->gpsLng,
|
||||||
];
|
];
|
||||||
|
|
||||||
// save settings
|
// save settings
|
||||||
@@ -70,12 +71,13 @@ class ContactForm extends Handler
|
|||||||
public static function edit(Content &$content, Request $request, $revisionID)
|
public static function edit(Content &$content, Request $request, $revisionID)
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'phone' => 'phone',
|
'phone' => 'phone',
|
||||||
'email' => 'email',
|
'email' => 'email',
|
||||||
'companyName' => 'companyName',
|
'contactEmail' => 'contactEmail',
|
||||||
'address' => 'address',
|
'companyName' => 'companyName',
|
||||||
'gpsLat' => 'gpsLat',
|
'address' => 'address',
|
||||||
'gpsLng' => 'gpsLng',
|
'gpsLat' => 'gpsLat',
|
||||||
|
'gpsLng' => 'gpsLng',
|
||||||
];
|
];
|
||||||
|
|
||||||
// get data and try to save them
|
// get data and try to save them
|
||||||
@@ -146,7 +148,7 @@ class ContactForm extends Handler
|
|||||||
$menu->dropdown(trans('contactform::admin/adminMenu.contactForm'), function ($submenu) use ($user) {
|
$menu->dropdown(trans('contactform::admin/adminMenu.contactForm'), function ($submenu) use ($user) {
|
||||||
$submenu->route('content.new', trans('contactform::admin/adminMenu.new'), ['moduleId' => self::getModuleId()], 10, ['icon' => 'fa fa-plus']);
|
$submenu->route('content.new', trans('contactform::admin/adminMenu.new'), ['moduleId' => self::getModuleId()], 10, ['icon' => 'fa fa-plus']);
|
||||||
$submenu->route('content.overview', trans('contactform::admin/adminMenu.overview'), ['moduleId' => self::getModuleId()], 20, ['icon' => 'fa fa-list']);
|
$submenu->route('content.overview', trans('contactform::admin/adminMenu.overview'), ['moduleId' => self::getModuleId()], 20, ['icon' => 'fa fa-list']);
|
||||||
// $submenu->route('emails.sent', trans('contactform::admin/adminMenu.sentMessages'), [], 30, ['icon' => 'fa fa-send']);
|
// $submenu->route('emails.sent', trans('contactform::admin/adminMenu.sentMessages'), [], 30, ['icon' => 'fa fa-send']);
|
||||||
}, 25, ['icon' => 'fa fa-envelope-o']);
|
}, 25, ['icon' => 'fa fa-envelope-o']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class ContactFormServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
$sourcePath = __DIR__ . '/../Resources/views';
|
$sourcePath = __DIR__ . '/../Resources/views';
|
||||||
|
|
||||||
$this->publishes([$sourcePath => $viewPath]);
|
$this->publishes([$sourcePath => $viewPath], 'module-views');
|
||||||
|
|
||||||
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
||||||
return $path . '/modules/contactform';
|
return $path . '/modules/contactform';
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ return [
|
|||||||
'gpsLng' => 'GPS longitude',
|
'gpsLng' => 'GPS longitude',
|
||||||
'compName' => 'Name displayed above address',
|
'compName' => 'Name displayed above address',
|
||||||
'phone' => 'Contact phone',
|
'phone' => 'Contact phone',
|
||||||
|
'email' => 'E-mail',
|
||||||
'contactEmail' => 'E-mail, where messages from this form will be delivered',
|
'contactEmail' => 'E-mail, where messages from this form will be delivered',
|
||||||
'contactInformation' => 'Contact information'
|
'contactInformation' => 'Contact information'
|
||||||
];
|
];
|
||||||
@@ -3,6 +3,7 @@ return [
|
|||||||
'columnPhone' => 'Phone',
|
'columnPhone' => 'Phone',
|
||||||
'columnAddress' => 'Address',
|
'columnAddress' => 'Address',
|
||||||
'columnEmail' => 'E-mail',
|
'columnEmail' => 'E-mail',
|
||||||
|
'columnContactEmail' => 'Contact E-mail',
|
||||||
'columnCompanyName' => 'Company name',
|
'columnCompanyName' => 'Company name',
|
||||||
'columnGpsLat' => 'GPS Latitude',
|
'columnGpsLat' => 'GPS Latitude',
|
||||||
'columnGpsLng' => 'Gps Longitude',
|
'columnGpsLng' => 'Gps Longitude',
|
||||||
|
|||||||
@@ -67,24 +67,18 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="column large-6">
|
<div class="column large-6">
|
||||||
|
|
||||||
|
<label>
|
||||||
|
@lang('contactform::admin/content.email')
|
||||||
|
|
||||||
|
<input type="email" name="email" value="{{$page->module_settings->email or ""}}" />
|
||||||
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
@lang('contactform::admin/content.phone')
|
@lang('contactform::admin/content.phone')
|
||||||
|
|
||||||
<input type="tel" name="phone" value="{{$page->module_settings->phone or ""}}" />
|
<input type="tel" name="phone" value="{{$page->module_settings->phone or ""}}" />
|
||||||
</label>
|
</label>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="column large-6">
|
|
||||||
<label>
|
|
||||||
@lang('contactform::admin/content.contactEmail')
|
|
||||||
|
|
||||||
<input type="email" name="email" value="{{$page->module_settings->email or \Auth::user()->email}}" />
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="column large-6">
|
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
@lang('contactform::admin/content.compName')
|
@lang('contactform::admin/content.compName')
|
||||||
@@ -98,16 +92,29 @@
|
|||||||
<textarea rows="3" name="address">{{$page->module_settings->address or ""}}</textarea>
|
<textarea rows="3" name="address">{{$page->module_settings->address or ""}}</textarea>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column large-6">
|
<div class="column large-6">
|
||||||
<label>
|
<label>
|
||||||
@lang('contactform::admin/content.gpsLat')
|
@lang('contactform::admin/content.contactEmail')
|
||||||
|
|
||||||
<input type="text" value="{{$page->module_settings->gpsLat or ""}}" name="gpsLat" />
|
<input type="email" name="contactEmail" value="{{$page->module_settings->contactEmail or \Auth::user()->email}}" />
|
||||||
</label>
|
</label>
|
||||||
<label>
|
|
||||||
@lang('contactform::admin/content.gpsLng')
|
|
||||||
|
|
||||||
<input type="text" value="{{$page->module_settings->gpsLng or ""}}" name="gpsLng" />
|
<div class="row">
|
||||||
</label>
|
<div class="column large-6">
|
||||||
|
<label>
|
||||||
|
@lang('contactform::admin/content.gpsLat')
|
||||||
|
|
||||||
|
<input type="text" value="{{$page->module_settings->gpsLat or ""}}" name="gpsLat" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="column large-6">
|
||||||
|
<label>
|
||||||
|
@lang('contactform::admin/content.gpsLng')
|
||||||
|
|
||||||
|
<input type="text" value="{{$page->module_settings->gpsLng or ""}}" name="gpsLng" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user