Skip to content

Commit

Permalink
Adds basic view for individual message body
Browse files Browse the repository at this point in the history
  • Loading branch information
Incognito committed Aug 9, 2015
1 parent 76e7f2a commit 9f45df9
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 25 deletions.
2 changes: 1 addition & 1 deletion app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public function registerBundles()
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Incognito\Bundle\MailQueueViewBundle\IncognitoMailQueueViewBundle(),
);

Expand Down
8 changes: 8 additions & 0 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ framework:
fragments: ~
http_method_override: true

sensio_framework_extra:
router: { annotations: false }
request: { converters: true, auto_convert: true }
view: { annotations: false }
cache: { annotations: false }
security: { annotations: false }
psr_message: { enabled: false }

# Twig Configuration
twig:
debug: "%kernel.debug%"
Expand Down
4 changes: 2 additions & 2 deletions app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production.
# http://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
parameters:
database_driver: ~
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
# You should uncomment this if you want use pdo_sqlite
# database_path: "%kernel.root_dir%/data.db3"
database_path: "%kernel.root_dir%/sqlite.db"

mailer_transport: smtp
mailer_host: 127.0.0.1
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~4.0",
"sensio/framework-extra-bundle": "~3.0,>=3.0.2",
"sensio/framework-extra-bundle": "^3.0",
"incenteev/composer-parameter-handler": "~2.0",
"doctrine/doctrine-fixtures-bundle": "^2.2"
},
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Incognito\Bundle\MailQueueViewBundle\Controller;

use Incognito\Bundle\MailQueueViewBundle\Entity\Message;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
Expand All @@ -17,4 +18,12 @@ public function indexAction()
array('messages' => $messages)
);
}

// Don't consider this part of an API
public function messageAction(Message $message)
{
return $this->render('IncognitoMailQueueViewBundle:Default:emailTemplate.html.twig',
array('message' => $message)
);
}
}
2 changes: 0 additions & 2 deletions src/Incognito/Bundle/MailQueueViewBundle/Entity/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Incognito\Bundle\MailQueueViewBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* Message
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
<route id="incognito_mail_queue_view_homepage" path="/">
<default key="_controller">IncognitoMailQueueViewBundle:Default:index</default>
</route>
<route id="incognito_mail_queue_view_message_body" path="/message/{message}">
<default key="_controller">IncognitoMailQueueViewBundle:Default:message</default>
</route>
</routes>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!doctype html>
<head>
<title>Test local content</title>
</head>
<body>
{{ message.body }}
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ul id="inboxTabs" class="tabs vertical" data-tab>
{% for message in messages %}
<li class="tab-title {% if loop.first %}active{% endif %}">
<a href="#panel{{ message.id }}">{{ message.headers }} {{ message.sender }}</a>
<a href="#panel{{ message.id }}">{{ message.subject }} {{ message.sender }}</a>
</li>
{% endfor %}
</ul>
Expand All @@ -15,18 +15,26 @@
{% for message in messages %}
<div class="content {% if loop.first %}active{% endif %}" id="panel{{message.id}}">
<p>
{{ message.id }}
{{ message.headers }}
{{ message.subject }}
{{ message.body }}
{{ message.contentType }}
{{ message.charset }}
{{ message.queuedAt|date("m/d/Y") }}
{{ message.sendAt|date("m/d/Y") }}
{{ message.sender }}
{{ message.recipients }}
{{ message.recipientsCC }}
{{ message.recipientsBCC }}
<div class="panel">
<h2>({{ message.id }}) {{ message.subject }}</h2>
<pre> {{ message.headers }}</pre>
{{ message.contentType }}
{{ message.charset }}
{{ message.queuedAt|date("m/d/Y") }}
{{ message.sendAt|date("m/d/Y") }}
</div>
<div class="panel">
{{ message.sender }}
{{ message.recipients }}
{{ message.recipientsCC }}
{{ message.recipientsBCC }}
</div>
<iframe sandbox src="{{
path(
'incognito_mail_queue_view_message_body',
{message: message.id}
)
}}"></iframe>
</p>
</div>
{% endfor %}
Expand Down

0 comments on commit 9f45df9

Please sign in to comment.