Frontenduser - Newsletter - Kombi + individuelle Profildaten

MediaMuchacho
Beiträge: 71
Registriert: Do 3. Nov 2005, 15:01
Wohnort: Ulm
Kontaktdaten:

Beitrag von MediaMuchacho » Sa 2. Jun 2007, 18:16

hi

der Link dürfte jetzt wieder gehen...ist mir doch glatt der Ordner abhanden gekommen beim letzten Webseite Redesign.

Eine Doku hab ich aber selbst nicht wirklich. Komme irgendwie garnicht dazu...vielleicht lässt sichs realisieren wenn der nächste Kunde das in ähnlicher Form mal wieder braucht.
Media in Vita - Medienagentur
Webdesign, Programmierung, Design

Freddy
Beiträge: 249
Registriert: Fr 6. Mai 2005, 21:01
Wohnort: Gummersbach
Kontaktdaten:

Beitrag von Freddy » Mo 11. Jun 2007, 23:32

Fehlt bei dem Downloadpacket nicht noch das Modul-Templates templates/feuser-edit.html ??

p.yotov
Beiträge: 5
Registriert: Mi 23. Mai 2007, 08:27
Kontaktdaten:

Beitrag von p.yotov » Do 14. Jun 2007, 10:36

Thanks for the module and for the info. One more question:

Is there any way for changing the group, not using the default one. I want to integrate two registration forms for two different groups. I have tried with two
Handlers but they are using only the default group.

Thanks p.yotov

HerrB
Beiträge: 6935
Registriert: Do 22. Mai 2003, 12:44
Wohnort: Berlin
Kontaktdaten:

Beitrag von HerrB » Do 14. Jun 2007, 22:17

I'm not familiar with all the details of this package. But this should be possible.

Generate the groups; configure the newsletter handler or form article to use user selected groups and select these groups.

Now the difficult part begins:
Take a look into the now final form article (on the webpage). You should get a select field containing the groups. Take a look into the HTML. Note the id of each group and the name of the select field.

Change the form template (this is the easiest way) and remove the {GROUPS} part and replace just by

Code: Alles auswählen

<input type="hidden" name="<Name of the select element>" value="<One of the ids>" />
.

Copy the module template (new module template + cut + paste) and change the id.

Clone the form module. Change the name of the template to the new one.

Now you have to form modules. Specify these modules in the article templates as needed and assign the templates to the articles/categories. -

If someone uses the article with the first module, he/she will get joined to the first group; if someone uses the other article with second module, he/she will get joined to the second group (so we have multiple join modules, but only one handler [and only one handler article, as it is not possible to use more than one]).

There are some glitches: If someone has joined, he/she can't join again (e.g. if he/she also likes to get joined to the second group).

It is possible to manipulate the id - so someone may join to the other group, if he/she knows the correct group id.

Regards,
HerrB

Note: If you don't get a selectbox if you have specified and activated user selected groups, than the module template may have been changed and the {GROUPS} is not available anymore. This is no problem, but then you have to take a look into the module output code window to get the information, how the select field would have been named. Additionally, you have to take a look into the Extras -> Newsletter -> Groups and the links to select a group to get the id.
Bitte keine unaufgeforderten PMs oder E-Mails -> use da Forum!

Newsletter: V4.4.x | V4.6.0-15 (Module, Backend) | V4.6.22+
Standardartikelliste: V4.4.x | V4.6.x
http://www.contenido.org/forum/search.php | http://faq.contenido.org | http://www.communido.net

XTC
Beiträge: 7
Registriert: Sa 7. Jul 2007, 18:06
Kontaktdaten:

Hallo erstmal

Beitrag von XTC » Sa 7. Jul 2007, 18:54

Jetzt ist es soweit ich habs kaputt gespielt. Lief alles Bestens aber jetzt :?

1. Nach der Anmeldung ist bei allen Benutzername = sysadmin
Woran kann das liegen?

2. Die Löschmodul funktioniert nicht mehr.
Ich denke das liegt auch an 1.

Bin gerade völlig ratlos wo ich noch suchen kann. Wer schön wenn mir jemand helfen könnte.

HerrB
Beiträge: 6935
Registriert: Do 22. Mai 2003, 12:44
Wohnort: Berlin
Kontaktdaten:

Beitrag von HerrB » So 8. Jul 2007, 17:09

Was hast Du denn geändert?

Gruß
HerrB
Bitte keine unaufgeforderten PMs oder E-Mails -> use da Forum!

Newsletter: V4.4.x | V4.6.0-15 (Module, Backend) | V4.6.22+
Standardartikelliste: V4.4.x | V4.6.x
http://www.contenido.org/forum/search.php | http://faq.contenido.org | http://www.communido.net

XTC
Beiträge: 7
Registriert: Sa 7. Jul 2007, 18:06
Kontaktdaten:

Beitrag von XTC » Mo 9. Jul 2007, 13:48

So habe es soweit wieder auf laufen. War ich wohl ein bisschen blind.
Die Fehler waren in den jeweiligen Modul-Templates.

Was mich jedoch jetzt noch stört ist, warum er bei den Newslettern den Namen übernimmt, jedoch im Frontend der Benutzername immer Sysadmin ist?!

wosch

Beitrag von wosch » Mo 9. Jul 2007, 14:51

XTC hat geschrieben: jedoch im Frontend der Benutzername immer Sysadmin ist?!
Vielleicht weil du gleichzeitig im Backend angemeldet bist und von daher der User sysadmin automatisch als User im Frontend übernommen wird?

XTC
Beiträge: 7
Registriert: Sa 7. Jul 2007, 18:06
Kontaktdaten:

Beitrag von XTC » Mo 9. Jul 2007, 19:26

Nein das ist es nicht. Andere haben sich auch schon angemeldet. Immer sysadmin.
Habs auch nochmal mit den unmodifizierten (von MediaMuchacho) Modulen probiert. Das gleiche Problem

kptkip
Beiträge: 192
Registriert: Mi 8. Jun 2005, 18:02
Kontaktdaten:

Beitrag von kptkip » Do 23. Aug 2007, 17:56

Das Output-Modul, das hier im rar-Archiv drinsteckt hat einige Bugs (s. Diskussion des Newsletter-Threads von HerrB).

hier mal die aktualisierte Version, damit lüppt es zumindest bei mir:
Output Handler-Modul

Code: Alles auswählen

<?php 
cInclude("classes", "class.newsletter.recipients.php"); 
cInclude("classes", "class.newsletter.php");
cInclude("classes", "class.frontend.users.php");
cInclude("classes", "class.phpmailer.php");
$objProperties = new PropertyCollection;
$objRecipients = new RecipientCollection; 
$strMessage = "&nbsp;";

$arrSettings = array();
$arrSettings["JoinSel"]         = $objProperties->getValue("clientsetting", $client, "newsletter", "joinsel");
$arrSettings["JoinMultiple"]    = $objProperties->getValue("clientsetting", $client, "newsletter", "joinmultiple");
$arrSettings["JoinGroups"]      = $objProperties->getValue("clientsetting", $client, "newsletter", "joingroups");
$arrSettings["FrontendLink"]    = $objProperties->getValue("clientsetting", $client, "newsletter", "frontendlink");
$arrSettings["FrontendConfirm"] = "CMS_VALUE[5]";
$arrSettings["FrontendDel"]     = "CMS_VALUE[6]";
$arrSettings["SenderEMail"]     = "CMS_VALUE[7]";

// Setting default values
if ($arrSettings["JoinSel"] == "" || $arrSettings["JoinGroups"] == "") {
   $arrSettings["JoinSel"] = "Default";
}
if ($arrSettings["FrontendConfirm"] == "") {
   $arrSettings["FrontendConfirm"] = "ActivateUser";
}
if ($arrSettings["FrontendDel"] == "") {
   $arrSettings["FrontendDel"] = "DeleteUser";
}

if ($action == "subscribe") { 

  if (!isset($email) || !$email) { 
    $strMessage = mi18n("Please specify an e-mail address.");
  } elseif (!isValidMail($email)) {
    $strMessage = mi18n("Please specify a valid e-mail address.");
  } elseif ($objRecipients->emailExists($email)) {
    $strMessage = mi18n("This e-mail address has been already registered for the newsletter.");
  } elseif (!isset($Nachname) || !$Nachname ) { 
    $strMessage = mi18n("Please specify a valid surname.");
  } elseif (!isset($Vorname) || !$Vorname ) { 
    $strMessage = mi18n("Please specify a valid name.");
  } else {
    $email = ereg_replace("\n", "", $email); 
    $email = ereg_replace("\r", "", $email); 
    unset($recipient);
 
    /* Analyze group specification */
    switch ($arrSettings["JoinSel"]) {
       case "Selected":
          $recipient = $objRecipients->create($email, $emailname, 0, $arrSettings["JoinGroups"]);
          break;
       case "UserSelected":
          $intSelCount = count($GroupSel);

          if ($intSelCount == 0) {
             $recipient = $objRecipients->create($email,$emailname); // No group selected
          } else {
             if ($intSelCount > 1 && $arrSettings["JoinMultiple"] != "enabled") {
                $strMessage = mi18n("Please select one group, only.");
             } else {
                /* Recipient wants to join special groups */
                $arrGroups = explode(",",$arrSettings["JoinGroups"]);

                /* Check, if received data is valid and matches the group selection */
                $blnError = false;
                foreach ($GroupSel as $join) {
                   if (!is_numeric($join) || !in_array($join, $arrGroups)) {
                      $blnError = true;
                      break;
                   }
                }

                if ($blnError) {
                   $strMessage = mi18n("There was an error processing your request. Please ask the webmaster for help.");
                } else {
                   $recipient = $objRecipients->create($email, $emailname, 0, implode(",",$GroupSel));
                }
             }	
          }
          break;
       default:
          $recipient = $objRecipients->create($email,$emailname);
    }

    if ($recipient) { 
      $mail       = new phpmailer();

      $blackboxidcatart = $objProperties->getValue("clientsetting", $client, "Newsletter", "idcatart");
      $body = mi18n("txtMailSubscribe")."\n".$cfgClient[$client]["path"]["htmlpath"]."front_content.php?changelang=".$lang."&idcatart=".$blackboxidcatart."&confirm=".$recipient->get("hash")."\n\n";

      $mail->From     = $arrSettings["SenderEMail"];
      $mail->FromName = $arrSettings["SenderEMail"];
      $mail->AddAddress($email);
      $mail->Mailer   = "mail";
      $mail->Subject  = mi18n("Newsletter: Confirmation");
      $mail->Body     = $body;
      // $mail->AltBody  = $body;

      if($mail->Send()) {
      // if (mail("$email", mi18n("Newsletter: Confirmation"), "$body", 'From: '.$arrSettings["SenderEMail"]."\n"."X-Mailer: Contenido [PHP/" . phpversion()."]")) {
        $strMessage = mi18n("Dear subscriber,<br>your e-mail address is now subscribed for our newsletter. You will now receive an e-mail asking you to confirm your subscription.");

        if ($arrSettings["FrontendLink"] == "enabled") {
           $frontendusers = new FrontendUserCollection;
           
           if (!$frontendusers->userExists($email)) {
              if ($frontenduser = $frontendusers->create($email)) {
                 if ($arrSettings["FrontendConfirm"] == "ActivateUser") { // Inform about frontend user account creation
                      
                      $strMessage .= mi18n("<br><br>After the confirmation you will also receive a password which you can use with your e-mail address to logon to special areas on this website.");
                      // Erweiterte FEUser Profil Daten speichern
                       $FEUserID = $frontenduser->get("idfrontenduser");
                       $oFEUser = new FrontendUser;
                       $oFEUser->loadByPrimaryKey($FEUserID);
                       
	  $oFEUser->setProperty("address", "title", $Titel);
	  $oFEUser->setProperty("address", "surname", $Vorname);
	  $oFEUser->setProperty("address", "name", $Nachname);
	  $oFEUser->setProperty("address", "zip", $Postleitzahl);
           $oFEUser->setProperty("adress", "city", $Ort);
	  $oFEUser->setProperty("address", "street", $Strasse);
	  $oFEUser->setProperty("address", "land", $Land);
	  $oFEUser->setProperty("address", "company", $Firma);
	  $oFEUser->setProperty("address", "telefone", $Telefon);
	  $oFEUser->setProperty("address", "fax", $Fax);
	  $oFEUser->setProperty("address", "mobile", $Mobil);
	  $oFEUser->setProperty("address", "homepage", $Homepage);
                 }
              } else {
                 $strMessage .= mi18n("<br><br>Sorry, there was a problem creating your website account. Please ask the webmaster for help.");
              }
           }
        }
      } else { 
        $strMessage = mi18n("Sorry, there was a problem sending the confirmation mail to your e-mail address. Please ask the webmaster for help."); 
      } 
    } else { 
      $strMessage = mi18n("Sorry, there was a problem subscribing your e-mail address for the newsletter. Please ask the webmaster for help."); 
    } 
  } 
} elseif ($action == "delete") { 
  if (!isset($email) || !$email) { 
    $strMessage = mi18n("Please specify an e-mail address.");
  } elseif (!isValidMail($email)) {
    $strMessage = mi18n("Please specify a valid e-mail address."); 
  } elseif ($recipient = $objRecipients->emailExists($email)) { 
    $mail       = new phpmailer();

    $blackboxidcatart = $objProperties->getValue("clientsetting", $client, "Newsletter", "idcatart");
    $body = mi18n("txtMailDelete")."\n".$cfgClient[$client]["path"]["htmlpath"]."front_content.php?changelang=".$lang."&idcatart=".$blackboxidcatart."&unsubscribe=".$recipient->get("hash")."\n\n"; 

    $mail->From     = $arrSettings["SenderEMail"];
    $mail->FromName = $arrSettings["SenderEMail"];
    $mail->AddAddress($recipient->get("email"));
    $mail->Mailer   = "mail";
    $mail->Subject  = mi18n("Newsletter: Cancel subscription");
    $mail->Body     = $body;
    // $mail->AltBody  = $body;

    if($mail->Send()) {
    // if (mail($recipient->get("email"), mi18n("Newsletter: Cancel subscription"), $body, 'From: '.$arrSettings["SenderEMail"]."\n"."X-Mailer: Contenido [PHP/" . phpversion()."]")) { 
      $strMessage = mi18n("Dear subscriber,<br>a mail has been sent to your e-mail address. Please confirm the cancelation of the newsletter subscription."); 
    } else { 
      $strMessage = mi18n("Sorry, there was a problem sending you the cancelation confirmation e-mail. Please ask the webmaster for help."); 
    } 
  } else {
    $strMessage = mi18n("Sorry, the e-mail address was not found.");
  }
} elseif (strlen($confirm) == 30 && is_alphanumeric($confirm)) {  
  $objRecipients->select("idclient = '$client' AND idlang='$lang' AND hash = '$confirm'"); 
  
  if ($recipient = $objRecipients->next()) { 
    // $idrecipient = $recipient->get("idnewsrcp");
	$idrecipient = $recipient->get("idnewsrcp");
    $email = $recipient->get("email");

    $recipient->set("confirmed",1); 
    $recipient->set("confirmeddate", date("Y-m-d H:i:s"), false); 
    $recipient->set("deactivated",0); 
    $recipient->store(); 

    $strMessage = mi18n("Thank you! You have confirmed your subscription to our newsletter!");

    $newsletters = New NewsletterCollection;
    $newsletters->select("idclient = '$client' AND idlang='$lang' AND welcome='1'"); 

    if ($newsletter = $newsletters->next()) { 
      $result = $newsletter->send($objProperties->getValue("clientsetting", $client, "Newsletter", "idcatart"),"single",$idrecipient);

      $strMessage .= mi18n(" The welcome newsletter is already on the way to you!");
    } 

    if ($arrSettings["FrontendLink"] == "enabled" && $arrSettings["FrontendConfirm"] == "ActivateUser") {
       $frontendusers = new FrontendUserCollection;
       $frontendusers->select("idclient = '$client' AND username='".urlencode($email)."'");

       if ($frontenduser = $frontendusers->next()) {
          $frontenduser->set("active",1);
          $pwd = substr(md5(rand()),0,8); // Generating password
          $frontenduser->set("password", $pwd);
          $frontenduser->store();



          $strMessage .= mi18n("<br><br>Additionally, your website account has been activated. You can now use the following username and password to log in to access special areas on our website:<br>");
          $strMessage .= mi18n("Username: ").$email.mi18n("<br>Password: ").$pwd;

          $body = mi18n("txtMailPassword")."\n\n".mi18n("Username: ").$email."\n".mi18n("Password: ").$pwd."\n\n".mi18n("Click here to login: ").$cfgClient[$client]["path"]["htmlpath"]."front_content.php?changelang=".$lang;

          $mail           = new phpmailer();
          $mail->From     = $arrSettings["SenderEMail"];
          $mail->FromName = $arrSettings["SenderEMail"];
          $mail->AddAddress($email);
          $mail->Mailer   = "mail";
          $mail->Subject  = mi18n("Website account");
          $mail->Body     = $body;
          // $mail->AltBody  = $body;

          if($mail->Send()) {
          // if (mail($recipient->get("email"), mi18n("Website account"), $body, 'From: '.$arrSettings["SenderEMail"]."\n"."X-Mailer: Contenido [PHP/" . phpversion()."]")) {
             $strMessage .= mi18n("<br><br>The account details and the password has also been sent to your mail account.");
          } else {
             $strMessage .= mi18n("<br><br><b>Sorry, there was a problem sending you the account details by mail. Please remember the given password.</b><b>");
          }
       } else {
          $strMessage .= mi18n("<br><br>Sorry, there was a problem activating your website account, also. Please ask the webmaster for help.");
       }
    }
  } else { 
    $strMessage = mi18n("Sorry, there was a problem confirming your subscription. Please ask the webmaster for help."); 
  } 
} elseif (strlen($stop) == 30 && is_alphanumeric($stop)) { 
  $objRecipients->select("idclient = '$client' AND idlang='$lang' AND hash = '$stop'"); 

  if ($recipient = $objRecipients->next()) { 
    $recipient->set("deactivated",1); 
    $recipient->store(); 

    $strMessage = mi18n("Your newsletter subscription has been paused.");
  } else { 
    $strMessage = mi18n("Sorry, there was a problem pausing your newsletter subscription. Please ask the webmaster for help."); 
  } 
} elseif (strlen($goon) == 30 && is_alphanumeric($goon)) { 
  $objRecipients->select("idclient = '$client' AND idlang='$lang' AND hash = '$goon'"); 

  if ($recipient = $objRecipients->next()) { 
    $recipient->set("deactivated",0); 
    $recipient->store();

    $strMessage = mi18n("Newsletter subscription has been resumed."); 
  } else { 
    $strMessage = mi18n("Sorry, there was a problem resuming your newsletter subscription. Please ask the webmaster for help."); 
  }  
} elseif (strlen($unsubscribe) == 30 && is_alphanumeric($unsubscribe)) { 
  $objRecipients->select("idclient = '$client' AND idlang='$lang' AND hash = '$unsubscribe'"); 

  if ($recipient = $objRecipients->next()) { 
    $strEMail = $recipient->get("email"); // Saving recipient e-mail address
    $objRecipients->delete($recipient->get("idnewsrcp")); 

    $strMessage = mi18n("Your e-mail address has been removed from our list of newsletter recipients.");

    if ($arrSettings["FrontendLink"] == "enabled") {
       $frontendusers = new FrontendUserCollection;
       $frontendusers->select("idclient = '$client' AND username='".urlencode($strEMail)."'");

       if ($frontenduser = $frontendusers->next()) {
          switch ($arrSettings["FrontendDel"]) {
             case "DeleteUser": // Deleting frontend account
                $frontendusers->delete($frontenduser->get("idfrontenduser"));
                $strMessage .= mi18n(" Your website account has been deleted.");
                break;
             case "DisableUser": // Disabling frontend account
                $frontenduser->set("active",0);
                $frontenduser->store();
                $strMessage .= mi18n(" Your website account has been disabled.");
                break;
             default:
          }
       }
    }
  } else { 
    $strMessage = mi18n("Sorry, there was a problem removing your e-mail address. Please ask the webmaster for help."); 
  }
}

echo $strMessage;
?> 

XTC
Beiträge: 7
Registriert: Sa 7. Jul 2007, 18:06
Kontaktdaten:

Beitrag von XTC » Mo 27. Aug 2007, 10:02

werde ich mir mal ankucken! Danke

tommo
Beiträge: 120
Registriert: So 27. Jun 2004, 21:34
Kontaktdaten:

Beitrag von tommo » Mi 19. Sep 2007, 12:42

hmm, ich verzweifel noch...

Bei mir wird der Benutzer zwar in die Newsletterliste eingetragen, nicht aber bei den Frontendusern. Woran kann das liegen?

Die Datei "feuser_edit.html" fehlt!!

vG,
Tom

XTC
Beiträge: 7
Registriert: Sa 7. Jul 2007, 18:06
Kontaktdaten:

Beitrag von XTC » Fr 19. Okt 2007, 11:17

ich hab das Problem dass ich mich nicht mehr löschen kann.
Anmelden geht ohne Probleme auch die Bestätigungsmail, jedoch bekomme ich keine Bestätigungsmails mehr zum löschen.
Woran kann das liegen?

hab die original mudule und templates wieder eingefügt; keine Ämderung?!

studioph1
Beiträge: 40
Registriert: Di 24. Mai 2005, 00:12
Kontaktdaten:

Email nicht vorhanden

Beitrag von studioph1 » So 25. Nov 2007, 21:26

Das Email Plugin fehlt im derzeitigem Download!

studioph1
Beiträge: 40
Registriert: Di 24. Mai 2005, 00:12
Kontaktdaten:

Beitrag von studioph1 » So 25. Nov 2007, 22:13

Kann mir jemand das Tool vollständig zur Verfügnung stellen:

Es fehlt das Email Plugin sowie auch die Edit.html

kann mir jemand helfen bitte?

Gesperrt