Jump to content

Send an E-Mail when you Page create


Niklas
 Share

Recommended Posts

  • 2 weeks later...

Thank you very much for your help. Now i am become a mail when new page is created.
But the problem is, that i want the Page URL of the new page in die mail, but that wont be delivered. What is wrong with my code?
 

<?php
$wire->addHookAfter("Pages::added", function(HookEvent $event){
$page = $event->arguments(0);

  // Email address of user that created page
  $userEmail = 'hello@test.com';
  // preparing and sending email
  $subject = __("Neue Lieferanfrage von Website");
  $textBody = sprintf( __("Guten Tag, Sie haben eine neue Lieferanfrage. Klicken Sie auf den Link um sie zu sehen:"), $page->url);
  $from = 'hello@test.com'; // if you have defined it in config page, you simply can send an empty string here
  $numSent = wireMail($userEmail, $from, $subject, $textBody);
});
?>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...