Seite 1 von 1
Zweite E-Mail Adresse einrichten
Verfasst: 08.03.2012, 11:44
von wolfschw
Hallo
[font='Calibri]Hätte gern im Kontaktformular vom Online-Shop noch ein Dropdown Auswahl hinzugefügt, [/font]
[font='Calibri]mit verschiedenen Auswahlmöglichkeiten [/font]
[font='Calibri]z.B. Bestellanfrage, Produktanfrage oder Allgemeine Anfrage. [/font]
[font='Calibri]Diese Auswahlmöglichkeiten sollten dann an verschiedene E-Mail Adressen zugeordnet sein,[/font]
[font='Calibri]die dann der entsprechende Mitarbeiter zugesandt bekommt. [/font]
[font='Calibri]Ist dieses Überhaupt möglich, und wie groß ist der Aufwand?[/font]
gruß
Wolfgang
Verfasst: 08.03.2012, 23:45
von r23
http://www.php-faq.de/q-formular-select-multiple.html
Code: Alles auswählen
<select multiple="multiple" size="3" name="avar[]">
<option value="a">Bestellanfrage</option>
<option value="b">Produktanfrage</option>
<option value="c">Allgemeine Anfrage</option>
hier kann der Kunde alle oder keines auswählen
oder wenn man nur eine Auswahlliste benötigt
http://wiki.selfhtml.org/wiki/Doku:HTML ... wahllisten
Code: Alles auswählen
<select name="avar" size="3">
<option value="a">Bestellanfrage</option>
<option value="b">Produktanfrage</option>
<option value="c">Allgemeine Anfrage</option>
im PHP Script steht nach der Absendung in
was der Kunde wünscht. (a,b oder c)
mit einer einfachen if else oder besser switch
http://de3.php.net/manual/de/control-st ... switch.php
Code: Alles auswählen
$avar= oos_var_prep_for_os($_POST['avar]);
switch ($avar) {
case 'a' :
// Bestellanfrage
$to_name = 'Name';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'b' :
// Produktanfrage
$to_name = 'Name';
$to_email_address = 'produktanfrage@example.org';
break;
case 'c' :
// Allgemeine Anfrage
$to_name = 'Name';
$to_email_address = 'allgemeine.anfrage@example.org';
break;
}
// oos_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $aLang['email_subject], $enquiry, $name, $email);
oos_mail($to_name, $to_email_address, $aLang['email_subject], $enquiry, $name, $email);
in die switch kann man auch noch default: festellegen. Bitte im PHP Handbuch nachlesen.
Hoffe, die Antwort hilft weiter?
ralf
Verfasst: 10.03.2012, 09:49
von wolfschw
Hallo
Habe es soweit hin bekommen, Funktioniert echt gut.
Habe nur ein kleines Problem,
am Ende wenn man auf Weiter klickt fählt man auf die Anfangsseite wieder zurück.
Normal kommt ja dann die Meldung das die Mail an den Vertrieb gesendet wurde.
gruß
Wolfgang
Verfasst: 10.03.2012, 14:10
von r23
Hallo,
nach dem Versenden der eMail steht
Code: Alles auswählen
oos_redirect(oos_link($aModules['main], $aFilename['contact_us], 'action=success'));
je nach Version muss man diesen Redirect anpassen.
Am besten die Zeile aus der original Datei verwenden.
Beste Grüße
Ralf
Verfasst: 10.03.2012, 17:50
von wolfschw
Habe ja die Zeile aus der Original-Datei verwendet.
Hier meine old_contact_us.html
Code: Alles auswählen
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>{$oosPageHeading}</td>
</tr>
<tr>
<td height="10"></td>
</tr>
{if $smarty.get.action eq 'success' }
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><img src="{$theme_image}/table_background_man_on_board.gif" border="0" alt="{$oos_heading_title}" width="175" height="198" align="left">{$lang.text_success}</td>
</tr>
<tr>
<td align="right">
<a href="{html_href_link modul=$modules.main file=$filename.main}">{html_image_button image="continue.gif" alt=$lang.image_button_continue}</a></td>
</tr>
</table></td>
</tr>
{else}
<tr>
<td>
{if $oEvent->installed_plugin('spell')}
<script type="text/javascript" src="js/googiespell/AmiJS.js"></script>
<script type="text/javascript" src="js/googiespell/googiespell.js"></script>
<script type="text/javascript" src="js/googiespell/cookiesupport.js"></script>
<link href="js/googiespell/googiespell.css" rel="stylesheet" type="text/css" media="all" />
{/if}
<form name="contact_us" action="{html_href_link modul=$modules.main file=$filename.contact_us action=send}" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main">{$lang.entry_name}
<input type="text" name="name" value="{$smarty.post.name}" size=40></td>
</tr>
<tr>
<td class="main">{$lang.entry_email}
<input type="text" name="email" value="{$smarty.post.email}" size=40> {if $error eq 'true'}{$lang.entry_email_address_check_error}{/if}</td>
</tr>
<tr>
<td class="main">{$lang.entry_categorie}
<select size="1" name="avar">
<option selected>Bitte Auswählen</option>
<option value="a">Angebotsanfrage</option>
<option value="b">Frage zur Bezahlung</option>
<option value="c">Frage zum Produkt</option>
<option value="d">Anfrage zur Lieferzeit</option>
<option value="e">Frage zu Login/Registrierung/Passwort</option>
<option value="f">Service Techniker</option>
</select></td>
</tr>
<tr>
<td class="main" height="42">{$lang.entry_enquiry}</td>
</tr>
<tr>
<td>
<span id="spell_container" style="background-color: #ddd"></span>
<textarea id="tal" name="enquiry" class="textarea" rows="15" cols="20">{$smarty.post.enquiry|stripslashes}</textarea>
{if $oEvent->installed_plugin('spell')}
{literal}
<script type="text/javascript">
var googie2 = new GoogieSpell("js/googiespell/", "send_req.php?lang=");
googie2.dontUseCloseButtons();
googie2.setSpellContainer("spell_container");
googie2.decorateTextarea("tal");
</script>
{/literal}
{/if}
</td>
</tr>
<tr>
<td class="main" align="right">
{html_image_submit image="continue.gif" alt=$lang.image_button_continue}</td>
</tr>
</table></form></td>
</tr>
{/if}
</table></td>
Hier meine old_contact_us.php
Code: Alles auswählen
<?php
/* ----------------------------------------------------------------------
$Id: old_contact_us.php,v 1.1 2007/06/07 16:50:51 r23 Exp $
OOS [OSIS Online Shop]
http://www.oos-shop.de/
Copyright (c) 2003 - 2007 by the OOS Development Team.
----------------------------------------------------------------------
Based on:
File: contact_us.php,v 1.39 2003/02/14 05:51:15 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) or die( 'Direct Access to this location is not allowed.' );
require 'includes/languages/' . $sLanguage . '/main_contact_us.php';
$avar= oos_var_prep_for_os($_POST['avar]);
switch ($avar) {
case 'a' :
// Angebotsanfrage
$to_name = 'a';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'b' :
// Frage zur Bezahlung
$to_name = 'b';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'c' :
// Frage zum Produkt
$to_name = 'c';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'd' :
// Frage zur Lieferzeit
$to_name = 'd';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'e' :
// Frage zum Login
$to_name = 'e';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'f' :
// Service Techniker
$to_name = 'f';
$to_email_address = 'bestellanfrage@example.org';
break;
}
$error = 'false';
if (isset($_GET['action]) && ($_GET['action] == 'send')) {
if (oos_validate_is_email(trim($email))) {
//oos_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $aLang['email_subject], $enquiry, $name, $email);
oos_mail($to_name, $to_email_address, $aLang['email_subject], $enquiry, $name, $email);
} else {
$error = 'true';
}
}
// links breadcrumb
$oBreadcrumb->add($aLang['navbar_title], oos_href_link($aModules['main], $aFilename['contact_us]));
$aOption['template_main] = $sTheme . '/system/old_contact_us.html';
$aOption['page_heading] = $sTheme . '/heading/page_heading.html';
$nPageType = OOS_PAGE_TYPE_MAINPAGE;
require 'includes/oos_system.php';
if (!isset($option)) {
require 'includes/info_message.php';
require 'includes/oos_blocks.php';
require 'includes/oos_counter.php';
}
// assign Smarty variables;
$oSmarty->assign(
array(
'oos_breadcrumb' => $oBreadcrumb->trail(BREADCRUMB_SEPARATOR),
'oos_heading_title' => $aLang['heading_title],
'oos_heading_image' => 'contact_us.gif',
'error' => $error
)
);
$oSmarty->assign('oosPageHeading', $oSmarty->fetch($aOption['page_heading]));
$oSmarty->assign('contents', $oSmarty->fetch($aOption['template_main]));
// display the template
require 'includes/oos_display.php';
?>
was habe ich übersehen ?
gruß
Verfasst: 10.03.2012, 19:24
von r23
[quote='wolfschw','index.php?page=Thread&postID=2363#post2363]
Hier meine old_contact_us.php
Code: Alles auswählen
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) or die( 'Direct Access to this location is not allowed.' );
require 'includes/languages/' . $sLanguage . '/main_contact_us.php';
$error = 'false';
if (isset($_GET['action]) && ($_GET['action] == 'send')) {
if (oos_validate_is_email(trim($email))) {
$avar= oos_var_prep_for_os($_POST['avar]);
switch ($avar) {
case 'a' :
// Angebotsanfrage
$to_name = 'a';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'b' :
// Frage zur Bezahlung
$to_name = 'b';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'c' :
// Frage zum Produkt
$to_name = 'c';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'd' :
// Frage zur Lieferzeit
$to_name = 'd';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'e' :
// Frage zum Login
$to_name = 'e';
$to_email_address = 'bestellanfrage@example.org';
break;
case 'f' :
// Service Techniker
$to_name = 'f';
$to_email_address = 'bestellanfrage@example.org';
break;
}
//oos_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $aLang['email_subject], $enquiry, $name, $email);
oos_mail($to_name, $to_email_address, $aLang['email_subject], $enquiry, $name, $email);
nach der oos_mail Zeile:
Code: Alles auswählen
oos_redirect(oos_href_link($aModules['main], $aFilename['contact_us], 'action=success'));
Hoffe es hilft weiter?
ralf