diff --git a/src/Controller/TradeController.php b/src/Controller/TradeController.php new file mode 100644 index 0000000..502cda9 --- /dev/null +++ b/src/Controller/TradeController.php @@ -0,0 +1,39 @@ +getUser(); + $offer = $offeringRepository->(); + + if(/* user not the logged in user */) + $email = (new Email()) + ->from('no-reply@pfleanz.li') + ->to(/* user of offer */) + ->replyTo(/* logged in user */) + ->subject('Time for Symfony Mailer!') + ->text('Sending emails is fun again!') + ->htmlTemplate('user/trade/offer_email.html.twig'); + try + { + $mailer->send($email); + } catch (TransportExceptionInterface $e) { + // TODO: + // print error + } + return $this->redirectToRoute('/offer', {'id': $id}); + } +} diff --git a/templates/offer/trade/trade_email.html.twig b/templates/offer/trade/trade_email.html.twig new file mode 100644 index 0000000..979ba20 --- /dev/null +++ b/templates/offer/trade/trade_email.html.twig @@ -0,0 +1,5 @@ +
You can checkout their offer and reply to this email if you want to trade.
+ + \ No newline at end of file