symfony 4: problem with twig stylesheets and path - twig

i worke with Symfony 4. Run the browser after installation and a nice welcome greeting shows. All good!
Then I created a new controller using make:controller. I named this controller Soumission and is using Annotations, same with the other Default Controller. I configured the routing as follows:
class SoummissionController extends AbstractController
{
/**
* #Route("/soumission/liste", name="liste_soumission")
*/
public function soumission()
{
return $this->render('soummission/liste_soumission.html.twig', [
'controller_name' => 'SoummissionController',
]);
}
}
And i created my view that extend base.html.twig as follows:
{% extends 'base.html.twig' %}
{% block title %}Hello SoummissionController!{% endblock %}
{% block body %}
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Ullam, magni incidunt voluptatem voluptas quos sint temporibus corrupti odit quae neque quis delectus saepe optio provident dolorum veritatis aliquid! Quod, iste!</p>
<p>Eveniet recusandae repudiandae id reprehenderit! Ex ab corrupti architecto quasi soluta totam, quae, commodi, vero accusantium repellendus placeat voluptate tenetur blanditiis a voluptatum nihil amet at expedita reiciendis distinctio odit.</p>
{% endblock %}
My page base.html.twig contains css and javascript as follows :
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="vendors/iconfonts/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="vendors/css/vendor.bundle.base.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/footer.css">
<link rel="shortcut icon" href="images/favicon.png" />
{% block stylesheets %}{% endblock %}
</head>
<div class="container-scroller">
{# partial:partials/_navbar.html #}
<nav class="navbar default-layout-navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row">
<div class="text-center navbar-brand-wrapper d-flex align-items-center justify-content-center">
<img src="images/logo.jpg" a.....
now when I try to access my page via the path: http://localhost:8000/soumission/liste the symfony server can not load the css and the javascripte of the base.html.twig page and the server trace level show me its errors as follows:
[Tue Mar 19 11:53:38 2019] 127.0.0.1:61350 [404]: /soumission/vendors/css/vendor.bundle.base.css
[Tue Mar 19 11:53:42 2019] 127.0.0.1:61357 [404]: /soumission/css/footer.css
[Tue Mar 19 11:53:45 2019] 127.0.0.1:61358 [404]: /soumission/images/logo.jpg
[Tue Mar 19 11:53:48 2019] 127.0.0.1:61360 [404]: /soumission/images/acceuil.jpg
[Tue Mar 19 11:53:51 2019] 127.0.0.1:61365 [404]: /soumission/vendors/js/vendor.bundle.base.js
[Tue Mar 19 11:53:53 2019] 127.0.0.1:61371 [404]: /soumission/vendors/js/vendor.bundle.addons.js
[Tue Mar 19 11:53:55 2019] 127.0.0.1:61376 [404]: /soumission/js/off-canvas.js
[Tue Mar 19 11:53:57 2019] 127.0.0.1:61382 [404]: /soumission/js/misc.js
[Tue Mar 19 11:53:59 2019] 127.0.0.1:61387 [404]: /soumission/js/dashboard.js
[Tue Mar 19 11:54:01 2019] 127.0.0.1:61390 [404]: /soumission/images/dao.png
[Tue Mar 19 11:54:02 2019] 127.0.0.1:61394 [404]: /soumission/images/soumission.png
[Tue Mar 19 11:54:04 2019] 127.0.0.1:61398 [404]: /soumission/images/comission.png
[Tue Mar 19 11:54:06 2019] 127.0.0.1:61402 [404]: /soumission/images/traitement.png
[Tue Mar 19 11:54:09 2019] 127.0.0.1:61406 [404]: /soumission/images/approbation.png
[Tue Mar 19 11:54:12 2019] 127.0.0.1:61408 [404]: /soumission/images/pv.jpg
[Tue Mar 19 11:54:14 2019] 127.0.0.1:61421 [404]: /soumission/images/favicon.png
[Tue Mar 19 12:19:25 2019] 127.0.0.1:62631 [404]: /soumission/liste
please, i need help

It's path problem
Try this
<link rel="stylesheet" href="{{ asset('vendors/iconfonts/mdi/css/materialdesignicons.min.css') }}">
<link rel="stylesheet" href="{{ asset('vendors/css/vendor.bundle.base.css') }}">
<link rel="stylesheet" href="{{ asset('css/style.css') }}">
<link rel="stylesheet" href="{{ asset('css/footer.css') }}">

Related

ValueError: "<User: harry1>" needs to have a value for field "id" before this many-to-many relationship can be used in Django

I need help with Django web Framework I cannot solve this problem or I cannot identify the source of the problem. Please help me with this problem the main problem is written in the title.
Here is my traceback for the error:
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "D:\Documents\CodingFox\CodingFox_final\CodingFox\Users\views.py", line 37, in registeration_form
form.save()
File "D:\Documents\CodingFox\CodingFox_final\CodingFox\Users\forms.py", line 18, in save
user = super().save(*args, **kwargs)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\contrib\auth\forms.py", line 131, in save
user.save()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\fields\related_descriptors.py", line 536, in __get__
return self.related_manager_cls(instance)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\fields\related_descriptors.py", line 851, in __init__
raise ValueError('"%r" needs to have a value for field "%s" before '
ValueError: "<User: harry1>" needs to have a value for field "id" before this many-to-many relationship can be used.
Models.py file
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from django.urls import reverse
import cv2
class Profile(models.Model):
user =models.OneToOneField(User, on_delete=models.CASCADE)
cover_img = models.ImageField(default='default.png',upload_to='cover_pics')
image = models.ImageField(default='default.jpg',upload_to='profile_pics')
# bio = models.TextField()
def __str__(self):
return f'{self.user.username} Profile'
def save(self ,*args, **kwargs):
super(Profile, self).save( *args, **kwargs)
img = cv2.imread(self.image.path)
output_size = cv2.resize(img,(300,300))
cv2.imwrite(self.image.path, output_size)
Forms.py
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django.forms import models
from .models import Profile
class UserRegistrationForm(UserCreationForm):
email=forms.EmailField(required=False)
class Meta:
model = User
fields = ['username','email','password1','password2']
class ProfileUpdateForm(forms.ModelForm):
class Meta:
model = Profile
fields = ['cover_img','image']
class UserLoginForm(AuthenticationForm):
class Meta:
model = User
fields = ['username','password']
Base.html
{% load static %}
{% load crispy_forms_tags %}
<!DOCTYPE html>
<html lang="en">
<head>
{% block head %}
{% endblock head %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="title" content="CodingFox: Pre Written Code snippets">
<meta name="description"
content="CodingFox can enhance the speed of programming by giving them pre-written code snippets.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://CodingFox.com/">
<meta property="og:title" content="CodingFox: Pre Written Code snippets">
<meta property="og:description"
content="CodingFox can enhance the speed of programming by giving them pre-written code snippets.">
<meta property="og:image" content="resoures/img/For_website.png">
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://CodingFox.com/">
<meta property="twitter:title" content="CodingFox: Pre Written Code snippets">
<meta property="twitter:description"
content="CodingFox can enhance the speed of programming by giving them pre-written code snippets.">
<meta property="twitter:image" content="resoures/img/For_website.png">
<link rel="stylesheet" href="{% static 'vendors/css/1.3 grid.css.css' %}">
<link href="https://unpkg.com/ionicons#4.5.10-0/dist/css/ionicons.min.css" rel="stylesheet">
<link rel="stylesheet" href="{% static 'vendors/css/normalize.css' %}">
<link rel="stylesheet" href="{% static 'vendors/css/prism-1.css' %}">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lato:wght#100;300;400;700;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="apple-touch-icon" sizes="57x57" href="{% static 'favicon/apple-icon-57x57.png' %}">
<link rel="apple-touch-icon" sizes="60x60" href="{% static 'favicon/apple-icon-60x60.png' %}">
<link rel="apple-touch-icon" sizes="72x72" href="{% static 'favicon/apple-icon-72x72.png' %}">
<link rel="apple-touch-icon" sizes="76x76" href="{% static 'favicon/apple-icon-76x76.png' %}">
<link rel="apple-touch-icon" sizes="114x114" href="{% static 'favicon/apple-icon-114x114.png' %}">
<link rel="apple-touch-icon" sizes="120x120" href="{% static 'favicon/apple-icon-120x120.png' %}">
<link rel="apple-touch-icon" sizes="144x144" href="{% static 'favicon/apple-icon-144x144.png' %}">
<link rel="apple-touch-icon" sizes="152x152" href="{% static 'favicon/apple-icon-152x152.png' %}">
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'favicon/apple-icon-180x180.png' %}">
<link rel="icon" type="image/png" sizes="192x192" href="{% static 'favicon/android-icon-192x192.png' %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'favicon/favicon-32x32.png' %}">
<link rel="icon" type="image/png" sizes="96x96" href="{% static 'favicon/favicon-96x96.png' %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'favicon/favicon-16x16.png' %}">
<link rel="manifest" href="{% static 'favicon/manifest.json' %}">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="{% static 'favicon/ms-icon-144x144.png' %}">
<meta name="theme-color" content="#ffffff">
<script src="{% static 'vendors/js/prism-1.js' %}"></script>
</head>
<body>
<nav>
<img src="{% static 'resoures/img/For_website.png' %}" alt="Logo_img" />
<div class="ion-md-menu nav_icon" id="nav_clickable"></div>
{% if user.is_authenticated %}
<div class="nav_icon-link">New Post</div>
<div class="nav_icon-link"><span class="ion-md-search"></span></div>
{% else %}
<div class="nav_icon-link">Login</div>
<div class="nav_icon-highlight">Register</div>
{% endif %}
<div class="clearfix"></div>
<div class="nav_box" id="nav_box">
{% if user.is_authenticated %}
<a href="" class="nav_box-link--person_img"><img src="{{ user.profile.image.url }}" alt="person-img"
srcset="" /></a>
<span class="ion-md-home"></span> {{ user.username }}
{% else %}
{% comment %} Unknown {% endcomment %}
{% endif %}
<span class="ion-md-moon"></span> Theme
<div class="nav_box-theme_box" id="theme_box">
<p>Change the color scheme to Dark colors.</p>
<h4>Toggle Theme</h4>
<input type="checkbox" name="" id="nav_box-theme_box-checkbox" />
</div>
<span class="ion-md-code"></span> Languages
<ul class="nav_box_language_box" id="lang_box">
<li>
<span class="ion-logo-html5"> HTML</span>
</li>
<li>
<span class="ion-logo-css3"> CSS</span>
</li>
<li>
<span class="ion-logo-python"> Python</span>
</li>
<li>
<span class="ion-logo-javascript"> JavaScript</span>
</li>
</ul>
{% if user.is_authenticated %}
<span class="ion-md-options"></span> Settings
<span class="ion-md-save"></span> Saved Posts
{% comment %} <span class="ion-md-home"></span> Home {% endcomment %}
<hr />
<span class="ion-md-log-out"></span> Log out
{% else %}
<span class="ion-md-log-in"></span> Login
<hr />
<span class="ion-md-person-add"></span> Register
{% endif %}
</div>
</nav>
<div class="message-box">
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}Important: {% endif %}
{{ message }}
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% block category %}
{% endblock category %}
{% block Post_loading %}
{% endblock Post_loading %}
{% block post %}
{% endblock post %}
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="{% static 'resoures/js/script.js' %}"></script>
<script src="{% static 'resoures/js/script-jquery.js' %}"></script>
<script src="{% static 'vendors/js/jquery.waypoints.min.js' %}"></script>
</body>
</html>
signup_form.html
{% extends 'base.html' %}
{% load static %}
{% load crispy_forms_tags %}
<head>
{% block head %}
<title>CodingFox | Register</title>
<link rel="stylesheet" href="{% static 'resoures/css/login.css' %}" />
{% endblock head %}
</head>
<body>
{% block post %}
<form action="" method="post" class="signup_form">
{% csrf_token %}
<h1>Welcome New User!</h1>
{% comment %} <label for="signup_email">Email :</label>
<input type="email" name="email" id="email">
<label for="signup_username">Username :</label>
<input type="text" name="username" id="username">
<label for="signup_password">Password :</label>
<input type="password" name="password" id="password"> {% endcomment %}
{{ form|crispy }}
{% comment %} <h4>Forgot Password?</h4> {% endcomment %}
<input type="submit" value="Register">
<hr>
<p>Already have a account?</p>
Login
</form>
{% endblock post %}
</body>
Views.py
def registeration_form(request):
if request.method == 'POST':
form=UserRegistrationForm(request.POST)
if form.is_valid():
form.save()
username=form.cleaned_data.get('username')
messages.success(request,f'Account created for {username}!')
return redirect('login_page')
else:
form=UserRegistrationForm()
context = {
'title':'Register',
'form':form
}
return render(request,'signup_form.html',context)
Urls.py
from django.contrib import admin
from django.urls import path, include
from . import views
urlpatterns = [
path('register/',views.registeration_form, name='register_page'),
]
Can you please give me a solution? This thing just worked a week ago but it's giving errors now. It is also giving errors for creating Post.

Invalid block tag on line 140: 'wagtailuserbar'. Did you forget to register or load this tag? Wagtail error

I am new to wagtail and I am not able to figure out why I am getting this error: Invalid block tag on line 140: 'wagtailuserbar'. Did you forget to register or load this tag?.
I am attaching the needful code.
--base.html--
{% load static from static %}
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<meta charset="utf-8" />
<title>
{% block title %}
Title
{% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}
{% endblock %}
{% block title_suffix %}
{% with self.get_site.site_name as site_name %}
{% if site_name %}- {{ site_name }}{% endif %}
{% endwith %}
{% endblock %}
</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{# Global stylesheets #}
<link rel="stylesheet" type="text/css" href="{% static 'css/mysite_blog.css' %}">
{% block extra_css %}
{# Override this in templates to add extra stylesheets #}
{% endblock %}
{% block head %}
{% endblock head %}
<style> </style>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
</head>
<body class="{% block body_class %}{% endblock %}">
{% wagtailuserbar %}
{% block content %}{% endblock %}
{# Global javascript #}
<script type="text/javascript" src="{% static 'js/mysite_blog.js' %}"></script>
{% block extra_js %}
{# Override this in templates to add extra javascript #}
{% endblock %}
<!-- Other Stuff -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</body>
</html>
a similar error occurred for {% static %} tag but was fixed by the 1st line in the above code. Please Help me with a solution to this error.
You can load both tags in the same load statement like this:
{% load static wagtailuserbar %}
from static is not needed.

Adding direct action for Google Mail (and maybe other software)?

I test all the examples with this mail sender: https://putsmail.com/tests/new
I read the documentation: https://developers.google.com/gmail/markup/getting-started#your_first_markup
And this is what I want (for example). Normally I want a normal URL Click action. Reservation is the next level.
First test was the JSON-LD one:
<html>
<body>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "IO12345",
"underName": {
"#type": "Person",
"name": "John Smith"
},
"reservationFor": {
"#type": "Event",
"name": "Google I/O 2013",
"startDate": "2013-05-15T08:30:00-08:00",
"location": {
"#type": "Place",
"name": "Moscone Center",
"address": {
"#type": "PostalAddress",
"streetAddress": "800 Howard St.",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94103",
"addressCountry": "US"
}
}
}
}
</script>
<p>
Dear John, thanks for booking your Google I/O ticket with us.
</p>
<p>
BOOKING DETAILS<br/>
Reservation number: IO12345<br/>
Order for: John Smith<br/>
Event: Google I/O 2013<br/>
Start time: May 15th 2013 8:00am PST<br/>
Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
</p>
</body>
</html>
Then I tried to use this Microdata thing:
<html>
<body>
<div itemscope itemtype="http://schema.org/EventReservation">
<meta itemprop="reservationNumber" content="IO12345"/>
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="John Smith"/>
</div>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/Event">
<meta itemprop="name" content="Google I/O 2013"/>
<time itemprop="startDate" datetime="2013-05-15T08:30:00-08:00"/>
<div itemprop="location" itemscope itemtype="http://schema.org/Place">
<meta itemprop="name" content="Moscone Center"/>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="streetAddress" content="800 Howard St."/>
<meta itemprop="addressLocality" content="San Francisco"/>
<meta itemprop="addressRegion" content="CA"/>
<meta itemprop="postalCode" content="94103"/>
<meta itemprop="addressCountry" content="US"/>
</div>
</div>
</div>
</div>
<p>
Dear John, thanks for booking your Google I/O ticket with us.
</p>
<p>
BOOKING DETAILS<br/>
Reservation number: IO12345<br/>
Order for: John Smith<br/>
Event: Google I/O 2013<br/>
Start time: May 15th 2013 8:00am PST<br/>
Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
</p>
</body>
</html>
But I never see this button. In the source code of the mail I see this:
Delivered-To: test#example.org
Date: Sun, 06 Mar 2016 22:40:14 +0000
From: putsmail#putsmail.litmus.com
To: test#example.org
Message-ID: <56dcb1cec7e4_33fda3a013ebc7595d#4fa974b3-34c5-49ef-99b3-2597dbeeb787.mail>
Subject: test
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_56dcb1ceba24_33fda3a013ebc75828";
charset=UTF-8
Content-Transfer-Encoding: 7bit
----==_mimepart_56dcb1ceba24_33fda3a013ebc75828
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
----==_mimepart_56dcb1ceba24_33fda3a013ebc75828
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<html>
<body>
<div itemscope itemtype="http://schema.org/EventReservation">
<meta itemprop="reservationNumber" content="IO12345"/>
<meta itemprop="reservationStatus" content="Ok"/>
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="John Smith"/>
</div>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/Event">
<meta itemprop="name" content="Google I/O 2013"/>
<time itemprop="startDate" datetime="2013-05-15T08:30:00-08:00"/>
<div itemprop="location" itemscope itemtype="http://schema.org/Place">
<meta itemprop="name" content="Moscone Center"/>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="streetAddress" content="800 Howard St."/>
<meta itemprop="addressLocality" content="San Francisco"/>
<meta itemprop="addressRegion" content="CA"/>
<meta itemprop="postalCode" content="94103"/>
<meta itemprop="addressCountry" content="US"/>
</div>
</div>
</div>
</div>
<p>
Dear John, thanks for booking your Google I/O ticket with us.
</p>
<p>
BOOKING DETAILS<br/>
Reservation number: IO12345<br/>
Order for: John Smith<br/>
Event: Google I/O 2013<br/>
Start time: May 15th 2013 8:00am PST<br/>
Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
</p>
</body>
</html>
----==_mimepart_56dcb1ceba24_33fda3a013ebc75828--
Maybe you know how this works?
You need to send the email from your own account or get whitelisted and authenticate the mail via DKIM or SPF. See https://developers.google.com/gmail/markup/registering-with-google for more details.

HTML based Email do not show in Hotmail & Gmail

I have a simple Email whose body is in HTML.
This is the simple HTML:
<html>
<head>
<meta charset="utf-8">
<link href="http://fonts.googleapis.com/css?family=Titillium+Web:200,300,400,600" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.ticket_holder {
width:800px;
height:480px;
background-image:url(http://www.domain.com/img/sorteos/billete_sorteo_24-07-2015.jpg);
float:left;
margin:10px auto;
position:relative;
}
.ticket_number {
width:277px;
height:60px;
text-align:center;
position:absolute;
top:290px;
left:450px;
font-size:42px;
color:#11AA00;
font-family: Titillium Web, sans-serif;
font-weight:bold;
}
</style>
</head>
<body>
<div class="ticket_holder">
<div class="ticket_number">0236</div>
</div>
</body>
</html>
Now, I will show the content of the Email gotten from a Gmail account. I think there must be an issue related to header but have no idea what should it is.
Delivered-To: fran#gmail.com
Received: by 10.37.71.193 with SMTP id u184csp169517yba;
Fri, 10 Jul 2015 12:10:37 -0700 (PDT)
X-Received: by 10.129.105.213 with SMTP id e204mr24861296ywc.97.1436555437024;
Fri, 10 Jul 2015 12:10:37 -0700 (PDT)
Return-Path: <bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com>
Received: from mail136-7.atl41.mandrillapp.com (mail136-7.atl41.mandrillapp.com. [198.2.136.7])
by mx.google.com with ESMTPS id k7si6464663ykd.6.2015.07.10.12.10.36
for <apalabrados.co#gmail.com>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Fri, 10 Jul 2015 12:10:36 -0700 (PDT)
Received-SPF: pass (google.com: domain of bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com designates 198.2.136.7 as permitted sender) client-ip=198.2.136.7;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com designates 198.2.136.7 as permitted sender) smtp.mail=bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com;
dkim=pass header.i=#mail136-7.atl41.mandrillapp.com;
dkim=pass header.i=#mandrillapp.com
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=mandrill; d=mail136-7.atl41.mandrillapp.com;
h=From:Sender:Subject:Reply-To:To:Message-Id:Date:MIME-Version:Content-Type; i=contacto#mail136-7.atl41.mandrillapp.com;
bh=QTHxKn1Liqi9ZJNIUiIqQFl0DNg=;
b=Wep3W+aIvU17Xwa1SNM0he9Bf403lXYidvKGtwiZpb9QrccWY0DBqImsEqnEGNBKMdSpTd/MdyYW
k2bgPf/yqHdwNXPDsqS3naEEs/gJC7dfIU+2zvGKp2fpGKsKyzhHkWITEMKV5DoMs3WPNKEPxopx
l7GY4JpTaaSm7f+4B3M=
DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=mail136-7.atl41.mandrillapp.com;
b=JIWGJJlHUZt5grcY4at3yqUabbvCI/KrS/VNplK+n+Ty9cDuCQQEANkExNamBojv+SMXsL8URPnl
igpbzKkhUk1WEvjufNYp6pZxAPkjHljuLpA+XdnYlgjCzvWJ4gI1QRuq3v5OeXxP6fcebsMSJrhn
rKWFKYfrMCpZx8v4NXk=;
Received: from pmta04.mandrill.prod.atl01.rsglab.com (127.0.0.1) by mail136-7.atl41.mandrillapp.com id hk0cao1sb1ko for <apalabrados.co#gmail.com>; Fri, 10 Jul 2015 19:09:11 +0000 (envelope-from <bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com>)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
i=#mandrillapp.com; q=dns/txt; s=mandrill; t=1436555350; h=From :
Sender : Subject : Reply-To : To : Message-Id : Date : MIME-Version :
Content-Type : From : Subject : Date : X-Mandrill-User :
List-Unsubscribe; bh=N1DazcpdS55HBslvogsYDTv2iLdRO0rnUDZkh9PCbtQ=;
b=OjcMKaAC4K4s1I3fpjFwqMGbYcayh7661XLVARyfmap3g1zZMW/+FWtGU2rzKrIF7wNbtC
+4E06pOycBBa7Q/D6BGk8CtLQLtWBe260o9X7d4gvBAl70/t0zyqbkucPx82AKzXe956cwsB
wiBB9xxxmgQdq/LJsmax3b1/+ZRWk=
From: "Contacto impresoras3d.com" <contacto#impresoras3d.com>
Sender: "Contacto impresoras3d.com" <contacto#mail136-7.atl41.mandrillapp.com>
Subject: =?utf-8?Q?Combinaci=C3=B3n=20Sorteo=2024/07/2015?=
Return-Path: <bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com>
Received: from [188.165.162.97] by mandrillapp.com id 94c0ce7842b842caaa20ee481b5d5bda; Fri, 10 Jul 2015 19:09:10 +0000
Reply-To: <contacto#impresoras3d.com>
To: <apalabrados.co#gmail.com>
X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse#mandrill.com
X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30672132.94c0ce7842b842caaa20ee481b5d5bda
X-Mandrill-User: md_30672132
Message-Id: <30672132.20150710190910.55a01856de9973.48448148#mail136-7.atl41.mandrillapp.com>
Date: Fri, 10 Jul 2015 19:09:10 +0000
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="_av-M8imh9jmVCY5HVEL4ea0TA"
--_av-M8imh9jmVCY5HVEL4ea0TA
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
0236
--_av-M8imh9jmVCY5HVEL4ea0TA
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta charset="utf-8">
<link href="http://fonts.googleapis.com/css?family=Titillium+Web:200,300,400,600" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.ticket_holder {
width:800px;
height:480px;
background-image:url(http://www.impresoras3d.com/img/sorteos/billete_sorteo_24-07-2015.jpg);
float:left;
margin:10px auto;
position:relative;
}
.ticket_number {
width:277px;
height:60px;
text-align:center;
position:absolute;
top:290px;
left:450px;
font-size:42px;
color:#11AA00;
font-family: Titillium Web, sans-serif;
font-weight:bold;
}
</style>
</head>
<body>
<div class="ticket_holder">
<div class="ticket_number">0236</div>
</div>
<img src="http://mandrillapp.com/track/open.php?u=30672132&id=94c0ce7842b842caaa20ee481b5d5bda" height="1" width="1"></body>
</html>
--_av-M8imh9jmVCY5HVEL4ea0TA--
Gmail strips the head tag and many email clients give limited support on styling of div tags. Your best bet is to convert the div to tables and inline the styles. See here for CSS compatability and here for an inliner.

IIRF reverse proxy problem

We have a java application ( Atlassian Bamboo) running on port 8085 on Windows 2003. It is accessile as http: //bamboo:8085.
I am trying to setup reverse proxy for IIS6 using IIRF so content is accessible via
http: //bamboo.
It seems that I set it ip correctly, and I can retrieve Status page.
This is how my IIRF.ini looks like:
RewriteLog c:\temp\iirf
RewriteLogLevel 2
StatusUrl /iirfStatus
RewriteCond %{HTTP_HOST} ^bambooi$ [I]
#This setup works
#ProxyPass ^/(.*)$ http://othersite/$1
#This does not
ProxyPass ^/(.*)$ http://bamboo:8085/$1
However when I type in http: //bamboo in IE, I get 'page cannot be displayed ' message.
FF does not return anything at all.
I made Wireshark network dump, selected 'follow TCPstream' and it seems like correct page is being retrieved.Why cannot I see it then?
I also noticed that I can retrieve http: //bamboo/favicon.ico so I must be very close to the solution..
This is the Wireshark output:
GET / HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
Accept-Language: en-gb
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Accept-Encoding: gzip, deflate
Host: bamboo
Connection: Keep-Alive
Cookie: JSESSIONID=wpsse0zyo4g5
HTTP/1.1 200 200 OK
Date: Sat, 30 Jan 2010 09:19:46 GMT
Server: Microsoft-IIS/6.0
Via: 1.1 DESTINATION_IP (IIRF 2.0)
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Dashboard</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="robots" content="all" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui-2.6.0/build/grids/grids.css" />
<!--<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui/build/reset-fonts-grids/reset-fonts-grids.css" />-->
<link rel="stylesheet" href="/s/1206/1/_/styles/main.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/main2.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/global-static.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/widePlanList.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/forms.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/yui-support/yui-custom.css" type="text/css" />
<link rel="shortcut icon" href="/s/1206/1/_/images/icons/favicon.ico" type="image/x-icon"/>
<link rel="icon" href="/s/1206/1/_/images/icons/favicon.png" type="image/png" />
<link rel="stylesheet" href="/s/1206/1/_/styles/bamboo-tabs.css" type="text/css" />
<!-- Core YUI-->
<link rel="stylesheet" type="text/css" href="/s/1206/1/_/scripts/yui-2.6.0/build/tabview/assets/tabview-core.css">
<link rel="stylesheet" type="text/css" href="/s/1206/1/_/scripts/yui-2.6.0/build/tabview/assets/skins/sam/tabview-skin.css">
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/yahoo/yahoo-min.js"></script>
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/event/event-min.js" ></script>
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/dom/dom-min.js" ></script>
<!--<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/animation/animation.js" ></script>-->
<!-- Container -->
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/container/container-min.js"></script>
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/connection/connection-min.js"></script>
<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui-2.6.0/build/container/assets/container.css" />
<!-- Menu -->
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/menu/menu-min.js"></script>
<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui-2.6.0/build/menu/assets/menu.css" />
<!-- Tab view -->
<!-- JavaScript Dependencies for Tabview: -->
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/element/element-beta-min.js"></script>
<!-- Needed for old versions of the YUI -->
<link rel="stylesheet" href="/s/1206/1/_/styles/yui-support/tabview.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/yui-support/round_tabs.css" type="text/css" />
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/tabview/tabview-min.js"></script>
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-2.6.0/build/json/json-min.js"></script>
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-ext/yui-ext-nogrid.js"></script>
<script type="text/javascript" src="/s/1206/1/_/scripts/bamboo.js"></script>
<script type="text/javascript">
YAHOO.namespace('bamboo');
YAHOO.bamboo.tooltips = new Object();
YAHOO.bamboo.contextPath = '';
YAHOO.ext.UpdateManager.defaults.loadScripts = true;
YAHOO.ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">Currently loading...</div>';
YAHOO.ext.UpdateManager.defaults.timeout = 60;
addUniversalOnload(addConfirmationToLinks);
</script>
<link rel="alternate" type="application/rss+xml" title="Bamboo RSS feed" href="/rss/createAllBuildsRssFeed.action?feedType=rssAll" />
</head>
<body>
<ul id="top">
<li id="skipNav">
Skip to navigation
</li>
<li>
Skip to content
</li>
</ul>
<div id="nonFooter">
<div id="hd">
<div id="header">
<div id="logo">
<img src="/images/bamboo_header_logo.gif" alt="Atlassian Bamboo" height="36" width="118" />
</div>
<ul id="userOptions">
<li id="loginLink">
<a id="login" href="/userlogin!default.action?os_destination=%2Fstart.action">Log in</a>
</li>
<li id="signupLink">
<a id="signup" href="/signupUser!default.action">Signup</a>
</li>
<li id="helpLink">
<a id="help" href="http://confluence.atlassian.com/display/BAMBOO">Help</a>
</li>
</ul>
</div> <!-- END #header -->
<div id="menu">
<ul>
<li><a id="home" href="/start.action" title="Atlassian Bamboo" accesskey="H"> <u>H</u>ome</a></li>
<li><a id="authors" href="/authors/gotoAuthorReport.action" accesskey="U">A<u>u</u>thors</a></li>
<li><a id="reports" href="/reports/viewReport.action" accesskey="R"> <u>R</u>eports</a></li>
</ul>
</div> <!-- END #menu -->
</div> <!-- END #hd -->
<div id="bd">
<div id="content">
<h1>Header here</h1>
<div class="topMarginned">
<div id='buildSummaryTabs' class='dashboardTab'>
</div>
<script type="text/javascript">
function initUI(){
var jtabs = new YAHOO.ext.TabPanel('buildSummaryTabs');
YAHOO.bamboo.tabPanel = jtabs;
// Use setUrl for Ajax loading
var tab3 = jtabs.addTab('allTab', "All Plans");
tab3.setUrl('/ajax/displayAllBuildSummaries.action', null, true);
var tab4 = jtabs.addTab("currentTab", "Current Activity");
tab4.setUrl('/ajax/displayCurrentActivity.action', null, true);
var handleTabChange = function(e, activePanel) {
saveCookie('atlassian.bamboo.dashboard.tab.selected', activePanel.id, 365);
};
jtabs.on('tabchange', handleTabChange);
var selectedCookie = getCookieValue('atlassian.bamboo.dashboard.tab.selected');
if (jtabs.getTab(selectedCookie))
{
jtabs.activate(selectedCookie);
}
else
{
jtabs.activate('allTab');
}
}
YAHOO.util.Event.onContentReady('buildSummaryTabs', initUI);
</script>
</div>
<script type="text/javascript">
setTimeout( "window.location.reload()", 1800*1000 );
</script>
<div class="clearer" ></div>
</div> <!-- END #content -->
</div> <!-- END #bd -->
</div> <!-- END #nonFooter -->
<div id="ft">
<div id="footer">
<p>
Powered by Atlassian Bamboo version 2.2.1 build 1206 -
<span title="15:59:44 17 Mar 2009">17 Mar 09</span>
</p>
<ul>
<li class="first">
Report a problem
</li>
<li>
Request a feature
</li>
<li>
Contact Atlassian
</li>
<li>
Contact Administrators
</li>
</ul>
</div> <!-- END #footer -->
</div> <!-- END #ft -->
Sergei, the ProxyPass directive in IIRF v2.0 did not correctly forward all Request headers, nor did it properly handle chunked encoding.
To use ProxyPass, you should move to IIRF v2.1, at least.
ps: your question really belongs on ServerFault.com
That "Via: 1.1 DESTINATION_IP (IIRF 2.0)" looks interesting.
Have you tried:
ProxyPass ^/(.*)$ http://localhost:8085/$1
Also, is the line:
RewriteCond %{HTTP_HOST} ^bambooi$ [I]
supposed to be:
RewriteCond %{HTTP_HOST} ^bamboo$ [I]

Resources