自動化的郵件格式我想通過SMTP發送郵件自動像像 - daily_closing.html.erb如何設計紅寶石
<p>Dear Sir,</p>
<p><b>Pending Indents :<%= @pending_indents %></b> <%= link_to '>>>', "http://www.industryprime.com/notifications/pending_indents" %> </p>
<p><b>Overdue Deliveries :<%= @overdue_delivery %></b> <%= link_to '>>>', "http://www.industryprime.com/notifications/pending_purchase_orders" %></p>
<p><b>Unapproved POs: <%= @unapproved_po_count %></b> <%= link_to '>>>', "http://www.industryprime.com/notifications/po_for_approval" %></p>
<p>Yesterday's GRNs</p>
<table border="1">
<thead>
<tr>
<th>Warehouse</th>
<th>Date</th>
<th>Item</th>
<th>Make/Catno</th>
<th>UOM</th>
<th>Qty</th>
<th>Closing</th>
<th></th>
</tr>
</thead>
<tbody>
<% @grns.each do |grn| %>
<tr>
<td><%= grn.warehouse.description %></td>
<td><%= grn.date.strftime("%d/%m/%y") %></td>
<td><%= grn.item.description %></td>
<% if grn.make_id != nil %>
<td><%= (grn.make.brand.name)+"/"+(grn.make.catno) %></td>
<%else %>
<td></td>
<% end%>
<td><%= grn.item.uom.shortform %></td>
<td><%= grn.quantity.round(2) %></td>
<td><%= grn.balance_quantity.round(2) %></td>
<%
if grn.make_id==nil
params = {
:item => grn.item_id,
:make => 0,
:date => Time.now,
:warehouse => grn.warehouse_id
}
else
params = {
:item => grn.item_id,
:make => grn.make_id,
:date => Time.now,
:warehouse => grn.warehouse_id
}
end
url = "http://www.industryprime.com/stockledgers?#{params.to_query}"
%>
<td><%= link_to '>>>', url %></td>
</tr>
<% end %>
</tbody>
</table>
<p>Yesterday's ISSUEs</p>
<table border="1">
<thead>
<tr>
<th>Warehouse</th>
<th>Date</th>
<th>Item</th>
<th>Make/Catno</th>
<th>UOM</th>
<th>Qty</th>
<th>Closing</th>
<th>To</th>
<th>Cost Centre</th>
<th>CF</th>
<th></th>
</tr>
</thead>
<tbody>
<% @issues.each do |issue| %>
<tr>
<td><%= issue.warehouse.description %></td>
<td><%= issue.date.strftime("%d/%m/%y") %></td>
<td><%= issue.item.description %></td>
<% if issue.make_id != nil %>
<td><%= (issue.make.brand.name)+"/"+(issue.make.catno) %></td>
<%else %>
<td></td>
<% end%>
<td><%= issue.item.uom.shortform %></td>
<td><%= issue.quantity.round(2) %></td>
<td><%= issue.balance_quantity.round(2) %></td>
<td><%= Issue.find(issue.ref_id).parentissue.worker.name %></td>
<% group = Costcentre.find(Issue.find(issue.ref_id).costcentre_id)
@leafgroup=Issue.find(issue.ref_id).costcentre.description
if group.predecessor !=nil
@pre=-1
@leafgroup=""
@group=group
until @pre==0 do
@leafgroup="." + @[email protected]
if @pre!=nil
@group=Costcentre.find_by_id(@group.predecessor)
[email protected]==nil
@pre=0
else
@[email protected]
end
else
@pre=0
end
end
@leafgroup[0]=""
end
%>
<td><%= @leafgroup %></td>
<td><%= Issue.find(issue.ref_id).costcentre_frequency %></td>
<%
if issue.make_id==nil
params = {
:item => issue.item_id,
:make => 0,
:date => Time.now,
:warehouse => issue.warehouse_id
}
else
params = {
:item => issue.item_id,
:make => issue.make_id,
:date => Time.now,
:warehouse => issue.warehouse_id
}
end
url = "http://www.industryprime.com/stockledgers?#{params.to_query}"
%>
<td><%= link_to '>>>', url %></td>
</tr>
<% end %>
</tbody>
</table>
<p>Warm regards,</p>
但我想設計一些CSS顏色..ie,行bgcolor..and其他一些顏色..不支持郵件內容.. 我該怎麼辦?
您需要將相關的樣式表或樣式添加到您的郵件發行版 – Iceman
是的,請在電子郵件的html頭部定義您的css – Fallenhero