Should I store the user's ID, name & email address in a session variable or should I query for the user's user's ID, name & email address everytime i need to use it?
I'm looking for a better test to determine when point is within a hidden attachment in mail-mode (which is used by wl-draft-mode). The attachments are mostly hidden and look like this:
--[[application/xls
Content-Disposition: attachment; filename="hello-world.xls"][base64]]
The test of invisible-p yields a result of nil. I am current using the following test, but it seems rather poor:
(save-excursion
(goto-char (point-max))
(goto-char (previous-char-property-change (point)))
(goto-char (previous-char-property-change (point)))
(re-search-backward "]]" (point-at-bol) t)))
Any suggestions would be greatly appreciated.
Here is the full snippet:
(goto-char (point-max))
(cond
((= (save-excursion (abs (skip-chars-backward "\n\t"))) 0)
(insert "\n\n"))
((and
(= (save-excursion (abs (skip-chars-backward "\n\t"))) 1)
(not
(save-excursion
(goto-char (previous-char-property-change (point)))
(goto-char (previous-char-property-change (point)))
(re-search-backward "]]" (point-at-bol) t))))
(insert "\n")))
GOAL: If there are no attachments and no new lines at the end of the buffer, then insert \n\n and then insert the attachment thereafter. If there is just one new line at the end of the buffer, then insert \n and then insert the attachment thereafter. If there is an attachment at the end of the buffer, then do not insert any new lines.
My web-app has to deliver db-generated content by email. The HTML need not include javascript but _does have to include images and CSS.
It's a safe bet that most users will be viewing this in Outlook. Are general guidelines different for html destined for email vs. IE?
I my application we sent registration email to customer and sends link in that email which contains url#historytoken. On click of this link customer should go to the page specified by that url for historytoken.We are using GWT so entry point handle the request for historytoken.
This works on all browsers except Safari.
Safari go to the url but cannot recognise the history token after that and remains on the url page.
Please help me solve this problem.
Just curious if I am overlooking something simple here. I have deployed the remote_form_for in the show.html.erb code before to render comments on a post (project in this case) without a problem. I have moved this code to the index view and seems to degrade to the normal form_for action (page refresh). I am not getting any javascript errors so not sure what is wrong here. Here is my code:
index.html.erb
<% remote_form_for [project, Comment.new] do |f| %>
<p>
<%= f.label :body, "New Comment" %><br/>
<%= f.text_area (:body, :class => "textarea") %>
</p>
<p>
<%= f.label :name, "Name" %> (Required)<br/>
<%= f.text_field (:name, :class => "textfield") %>
</p>
<p>
<%= f.label :email, "Email" %> (Required but will not be displayed)<br/>
<%= f.text_field (:email, :class => "textfield") %>
</p>
<p><%= f.submit "Add Comment" %></p>
<% end %>
CommentsController#create
def create
@project = Project.find(params[:project_id])
@comment = @project.comments.create!(params[:comment])
respond_to do |format|
format.html { redirect_to projects_path }
format.js
end
end
/views/comments/create.js.rjs
page.insert_html :bottom, :commentwrapper, :partial => @comment
page[@comment].visual_effect :highlight
page[:new_comment].reset
page.replace_html :notice, flash[:notice]
flash.discard
/views/comments/_comment.html.erb
<% div_for comment do %>
<div id="commentwrapper">
<% if admin? %>
<%=link_to_remote "X", :url => [@project, comment], :method => :delete %>
<% end %>
<%= h(comment.body) %><br/><br/>
Posted <%= time_ago_in_words(comment.created_at) %> ago by <%= h(comment.name) %>
<% if admin? %>
| <%= h(comment.email) %>
<% end %></div>
<% end %>
I am integrating LDAP authentication in my web enterprise application. I would like to show listing of people name and email. Instead of querying the LDAP server for the name and email each time a listing containing several users I thought about caching the data locally in the database.
Do you guys know about caching LDAP data best practices?
Should I cache LDAP user data?
When should I insert and refresh the data?
Hi everyone,
Curious if any of you have a good solution for the following situation... because I've never thought of anything myself and usually have to resort to custom fields like "post-image-1" through "post-image-10" and manually paste the file name of a jpg in. Which is a horrible solution and only works for tech savvy posters.
Basically I want non-tech savvy users to be able to upload / attach (but not insert into the actual post content) multiple images to a post, which will be turned into a makeshift gallery.
Then I want to output these attachments in a list down the page after the post, using basic jQuery lightbox gallery functionality.
It doesn't have to be through attachments, it could be a stand alone plugin, as long as it offers customizable markup. Basically any solution that would achieve the same thing would be incredible.
Has anyone done this before? Am I missing something terribly obvious? I don't even know what exactly to call this, so I haven't had much luck with my Google research so far :(
Thanks!
I'm new to Django and have some code in my views.py like this:
try:
myfunction()
except:
assert False, sys.exc_info()[0]
This is very helpful because I get an email with lots of useful info if there's an error.
The problem is that it also redirects the user to a Webfaction system error page. What I'd like to know is how do I still get the useful error email, but redirect the user to my own error page?
Also, is this the best way to be handling errors in Django?
I'm trying to add facebook connect button to my ZF web site. After i click on FB connect button the popup with email and password fields opens. But when i send email and password to login with facebook the popub don't close and reload the same page where the facebook connect button was.
Any idea?
Sorry for my english ..
Is there any good framework for comparing whole objects?
now i do
assertEquals("[email protected]", obj.email);
assertEquals("5", obj.shop);
if bad email is returned i never get to know if it had the right shop, i would like to get a list of incorrect fields.
I have a simple index page for clients. Client has 20 fields. I am displaying list of clients in a table. For this I have to write in my views something like:
- @clients.each do |client|
%tr
%td=client.name
%td=client.email
%td=client.address
%td=client.phone etc...
I am just curious if I can do it something like
- @clients.each do |client|
- client do
%tr
%td= name
%td= email
%td= address
%td= phone etc...
Hi I want to resync my appointments in MS Exchange's calendar, to email client calendar to avoid overflowing of meetings. This is easy using MS Outlook...but the licensing issue is too much.
Is there any ways we can do this using opensouce email client which is Thunderbird?
Thanks
I recently registered a oneindia domain and they provided a email account at my domain name
i.e http://webmail.mydomain.com
is tat email account is reliable??can i use tat mail for important projects??
I have a Workflow 4.0 app that generates emails. In a dialog for creating the email body the user needs to be able to input some string value representing an existing wf instance variable to be inserted as a string at runtime.
So they input something like: Email body text including <.
(say ExistingVariable is an int or something like that)
Any helpful hints for how to convert this text with a ToString() at runtime?
I cant seem to send an email using PHP's mail(). I have also tried PHPMailer and Swiftmail with no success. However, the following command on the server delivers mail successfully.
cat test.txt | mail -s "test mail" [email protected]
Is there a way to trace where the problem is coming from? mail() just seems to return true or false.
Mailto links are not working at all in Chrome (8.0.552.224).
These links are working in IE 7&8, Safari, and Firefox.
In Chrome, we are clicking on mailto links (we have tested this about 25 times now), and things just go into the ether.
In all other browsers, we click on the mailto links, they open up email clients (gmail, outlook, and others), and we can send the email.
But in Chrome, we click the mailto links and nothing happens...
is there anywhere such script that includes a cakephp user management part,
view - registration form ( for example allowing to enter: first name, surname, email, user address, user phone number, last login date etc. )
sends confirmation to email - about registration
inserts users data into mysql tables (users id, etc.) and blocks duplicate entries to users tables
or does other similar tasks
etc.
if there is no such plugin then may be someone can send the custom made scripts
How can I implement following logic?
User registers with an e-mail address
If provided e-mail address is a valid
email address Then user account get's
activated
or if it is a fake email then user
account is not activated
I doubt that I can catch the - "Delivery failed reply message", right?
anyhow how would you suggest to implement the above logic?
PS. I will have to find a way no matter what, client wants it =)
Hello there,
I am try to find out how to enforce uniqueness in fields other than the unique id.
Example:
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class User implements IsSerializable {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
@Persistent
private String name;
@Persistent
private String email; // <= I want this to be unique as well
}
In the example above, how can I enforce uniqueness of the email value across the database?
Daniel
I recently had an incident where the email details of a Sharepoint user were changed in Active Directory. These changes were not transferred into SharePoint and I had a problem in one of my web parts which uses the SPUser object to get the users email address.
Is there a way to configure Sharepoint to synchronise such data automatically?
Hey,
I have two textbox called BIRTH & EMAIL, and I must test in button click if the user has typed a date & email format in those two TextBox.
How can do that ?
I have a query that gets a list of emails who have subscribed for a newsletter trial which lasts 30 days..
$thirty = time() - 3024000;
SELECT c.email FROM tbl_clients AS c JOIN tbl_clientoptions AS o ON o.client = c.id WHERE o.option = 'newsletter' AND c.datecreated $thirty
What I want to do is do a check in that same query so it also returns clients OVER 30 days old if they have the tbl_clientoptions.option = 'trialoverride' (ie; a row in the client options table with the value "trialoverride")
basic columns are:
TBL_CLIENTS
id,name,email,datecreated
TBL_CLIENTOPTIONS
id,client,option
So I added some code in my css and there are boxes that appear over every image that is attached to a post. I've wanted to number the images and show the image number in the box(1...n). I have this in my functions.php
function count_images(){
global $post;
$thePostID = $post-ID;
$parameters = array(
'post_type' = 'attachment',
'post_parent' = $thePostID,
'post_mime_type' = 'image');
$attachments = get_children($parameters);
$content = count($attachments);
return $content;
}
add_filter('the_content','count_images');
function caption_image_callback($matches) {
$c = count_images();
for ($i=1; $i <= $c; $i++) {
if (is_single()) {
return ''.$i.'
';
}
else {
return '';
}
}
}
function caption_image($post_body_content) {
$post_body_content = preg_replace_callback("||","caption_image_callback",$post_body_content);
return $post_body_content;
}
if ( current_user_can('edit_plugins') ) {
add_filter('the_content', 'caption_image'); }
If I run only count_images it will show the correct number of attached images to a post(let's say 15). But for some reason the number that is shown in the boxes over the images is always 1. I've seen this done on several blogs with just php so there has to be a way(even if I have to change my whole code).
PS: I had to leave spaces in some places
public class InvestorMailing
{
public string To { get; set; }
public IEnumerable<string> Attachments { get; set; }
public int AttachmentCount { get; set; }
public long AttachmentSize { get; set; }
}
i have an IList<InvestorMailing> mailingList. if the attachment size is greater than x, then i need to split my object into chunks. is there an easy linq-y way to do this?
Edited:
this is how i'm generating my mailings:
var groupedMailings = mailingList.GroupBy(g => g.GroupBy);
var investorMailings = groupedMailings.Select(
g => new DistinctInvestorMailing
{
Id = g.Select(x => x.Id).FirstOrDefault(),
To = g.Key.Trim(),
From = g.Select(x => x.From).FirstOrDefault(),
FromName = g.Select(x => x.FromName).FirstOrDefault(),
Bcc = g.Select(x => x.Bcc).FirstOrDefault(),
DeliveryCode = g.Select(x => x.DeliveryCode).FirstOrDefault(),
Subject = g.Select(x => x.Subject).FirstOrDefault(),
Body = g.Select(x => x.Body).FirstOrDefault(),
CommentsOnStatus = g.Select(x => x.CommentsOnStatus).FirstOrDefault(),
Attachments = g.Select(x => x.AttachmentPath),
AttachmentCount = g.Select(x => x.AttachmentPath).Count(),
AttachmentSize = g.Sum(x => x.AttachmentSize),
MailType = g.Select(x => x.MessageType).FirstOrDefault()
}
).ToList();